Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000 - serialInRecord


jutta Apr 25, 2012 07:46 PM

Hello,
I am trying to read data at 10 Hz from the RS232 (Com3) and the ethernet (NL115) with a CR1000. Unfortunately, I get a lot of error meassages from the serial data.
What would be the correct command line using serialinrecord for a line, which looks like this?
M: x = 36 y = 41 z = 2 Ts = 1524

in case of errors, the line starts with E:

I am currently using the serialIn command:
SerialIn (wind_string,Com3,300,10,50)

Thank you!


Sam Apr 26, 2012 02:42 AM

Maybe try something like the following. I am assuming that the string is terminated with a carriage return and line feed.

Dim Dest As String * 63
Dim NBytesReturned

DataTable (Test,1,1000)
Sample (1,Dest,String)
EndTable

BeginProg
SerialOpen (Com3,9600,3,0,2000)
Scan (1,Sec,0,0)
Do
SerialInRecord (Com3,Dest,10,0,13,NBytesReturned,11)
If Dest <> "NAN" Then
'do something with the string
CallTable Test 'like put it into a table
EndIf
Loop While NBytesReturned > 0
CallTable Test
NextScan
EndProg

Log in or register to post/reply in the forum.