14.03.2014 Views

Automation Reference - JMP

Automation Reference - JMP

Automation Reference - JMP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Application Object <strong>Reference</strong> for Automating <strong>JMP</strong><br />

DataFeed Object<br />

DataFeed Object<br />

The DataFeed object provides a way to read data from a serial port. This allows a user to hook up an instrument, read<br />

the values through <strong>JMP</strong>, and use them in the automation client program.<br />

Methods<br />

Close() As Boolean<br />

Closes the connection to the port, cleans up the information about the port and tells <strong>JMP</strong> that this data feed<br />

object is closed. Any further attempt to use this data feed object will fail. A return value of True indicates<br />

success, False indicates Failure.<br />

Connect(PortName As String) As Boolean<br />

Attempts to establish a connection to the named port using the parameters that have either been previously<br />

specified in SetCommParms or in <strong>JMP</strong>. Returns True if successful, False otherwise. An example of a valid port<br />

name is COM1.<br />

Disconnect() As Boolean<br />

Disconnects from the port associated with this datafeed, but keeps the port information for use in a later<br />

Connect(PortName As String) As Boolean. A return value of True indicates success.<br />

GetLine() As String<br />

Reads a data element from a port and returns the value as a string.<br />

SetCommParms(BSTR szCommPort, long baudrate, short parity, short databits, short stopbits, short flow)<br />

As Boolean<br />

Set up the parameters for a serial port. If zero is specified for a particular value, then the values specified in <strong>JMP</strong><br />

Preferences are used. If no preferences have been set, a default value is used. The szCommPort parameter is<br />

mandatory. Returns True if successful, False otherwise. An example of a valid port name is COM1. Values for<br />

parity should be obtained from the commParityConstants enumeration. Values for flow control can be a logical<br />

Or operation of any of the values from the commFlowControlConstants enumeration, or can be 0 for no flow<br />

control.<br />

Page 52

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!