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.

SerialInRecord for different instruments in one COM


koxme Jul 2, 2021 12:43 PM

Hi everyone,

I am trying to read two RS485 instruments with different ID (thies vane 4.3151.00.400) in one COM but I didn´t manage to separate the strings coming from the two instruments.

I tried sequentialmode and other waitstring combinations, but I still didn´t figure out how to use the the serialinrecord instruction correctly.

The format coming from the vane is:(<STX>xx.x xxx.x*HL<CR><ETX>)

I guess there is a way to do it althought I didn´t find it yet.

Could somebody please send me a clue?

Thanks

'++++++++++++++++++++++++

' First (ID=00)
Dim ThiesOutput0 As String *35 ' make Public to debug
Dim NBytesReturned0 ' make Public to debug
Public ThiesParsed0(3)
Alias ThiesParsed0(2)= WD_TOP

' second (ID=01)
Dim ThiesOutput1 As String *35 ' make Public to debug
Dim NBytesReturned1 ' make Public to debug
Public ThiesParsed1(3)
Alias ThiesParsed1(2)= WD_CTRL

'+++++++++++++++++

SerialOpen (ComC5,9600,3,100,1000,4)

'+++++++++++++++++++

'first
SerialOut (ComC5,"00TR00003" & CHR(13),"",0,0)
SerialInRecord (ComC5,ThiesOutput0,&H02,0,&H03,NBytesReturned0,00)
SplitStr (ThiesParsed0(),ThiesOutput0," ",2,5)


'second

SerialOut (ComC5,"01TR00003" & CHR(13),"",0,0)
SerialInRecord (ComC5,ThiesOutput1,&H02,0,&H03,NBytesReturned1,00)
SplitStr (ThiesParsed1(),ThiesOutput1," ",2,5)

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