snap ethernet-based i/o units protocols and programming guide
snap ethernet-based i/o units protocols and programming guide
snap ethernet-based i/o units protocols and programming guide
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CHAPTER 3: USING THE SNAP ETHERNET I/O DRIVER TOOLKIT<br />
Dim StreamBlock As SIOMM_StreamSt<strong>and</strong>ardBlock<br />
' Get the last stream block<br />
nResult = gBrain.GetLastStreamSt<strong>and</strong>ardBlockEx(StreamBlock)<br />
If (nResult = SIOMM_OK) Then<br />
' If no error, do something with the data<br />
Else<br />
' Check the result<br />
H<strong>and</strong>leError (nResult)<br />
End If<br />
End If<br />
End Sub<br />
Stop Listening <strong>and</strong> Clean Up<br />
Use the StopStreamListening() <strong>and</strong> CloseStreaming() methods to clean up. For example:<br />
' Stop listening<br />
nResult = gBrain.StopStreamListening("10.20.30.40")<br />
' Close the connection<br />
nResult = gBrain.CloseStreaming()<br />
Interface Introduction<br />
Here are the interfaces for the ActiveX components <strong>and</strong> C++ classes. Since the interfaces are<br />
very similiar <strong>and</strong> the components may be used from different languages, the information is<br />
presented in a general format.<br />
Basic Data Types<br />
The following data types are used. They may have different names in different languages.<br />
byte: 8-bit signed integer<br />
short: 16-bit signed integer<br />
long: 32-bit signed integer<br />
string: string<br />
float: 32-bit float<br />
by_array: an array of bytes<br />
l_array: an array of long integers<br />
f_array: an array of floats<br />
SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide 59