Red Lion DSP Serial Help

If the data has carriage return or line feed at the end of the string then I would use PortInput. See the reference manual. PortInput(Port,Start,End,Timeout,Length)

Typically I set as
RecvStr := PortInput(CommPortNum, 0, 13, 0, MaxStrlngth)

That way I do not timeout, I can set a pre-defined length or set Maxlngth to 0 for read until carriage return.
I will sometimes use a timeout if I know I am having comm issues with the sending device.

Is you data delimited?
Parsing would be relatively easy with a loop.
 
String parsing is generally done with combinations of the following functions:
Left()
Right()
Mid()
Len()
Find()
 
Program1 is simply:
//raw serial string
cstring _SerialString;
Ditch the underscore. Always start your tags names with a letter. I say this because I had a problem when I was ending my tags with an underscore and a number, called tech support, they told me not to end tags that way, problem solved...I don't recall the details, but I was advised to start my tags with a letter in that same conversation.

This is among the (very few) quirks in Crimson. I am not sure about the leading underscore being okay, actually, but it is suspect for sure. Let us know if it's indeed okay to start a tag name that way.

I agree with what was said about verifying cabling, and sometimes using hyperterminal or one of its cousins is a better tool, since you know its source code works...once you get hyperterminal to do much of anything, your cable is proven.
 
Last edited:

Similar Topics

This is the set-up we have, and we recently lost comms to two devices on this PLC. After replacing the red lion and copying in another identical...
Replies
3
Views
1,862
Greetings, I would like to print just five lines of data to a Zebra S4M printer. I would like to use the Ethernet Port, but open to suggestions...
Replies
0
Views
1,554
Greetings, I would like to print just five lines of data to a Zebra S4M printer. I would like to use the Ethernet Post but open to suggestions. I...
Replies
0
Views
1,292
Hi guys, I developed an application on a Red Lion DataStation Plus DSPSX device, which has a small "Virtual HMI" you can access via Web browser...
Replies
3
Views
2,801
Hey guys, I'm working with a PTV and am wondering if somebody knows of a way to log the info in the alarm/event viewer into a file other than...
Replies
2
Views
1,722
Back
Top Bottom