Crimson 3.1 "background task"

ealan

Member
Join Date
Jan 2011
Location
Ohio
Posts
8
Hi,

I was wondering if the Red Lion Crimson 3.1 system had a background thread I can tap into to process Raw serial data from a device?

My device is sending the following string '-036298605,-000930576,15,63<LF>' 3 to 4 times a second. There's no unique starting character or field markers, just the "," and the line feed <LF>. The starting sign could be '+'. The device sends this data automatically and constantly.

With other advice here, I am able to process this data using fake data. I cobbled something together to send a sample message once a second and placed my code in the 'OnTick' routine of the three data pages that will display the data. I was able to parse the message and place the values into the correct tags.

I was hoping to place my 'Processing' routine in some sort of background thread so I would be able to read 'constantly' and better handle the message.

Any places to look for good place to process this data?

Thanks.
 
Create a program and make an infinite loop inside it, using while(true){} or something similar. In the program's Properties tab, change the Execution Task from Same as Caller to Background 1. Then, within the infinite loop, put your code to receive and parse the serial data. It sounds like you already have this figured out but you could use PortInput() to receive a certain number of characters based on a variety of criteria. All that's left is to start the program, which could be done in the global 'On Startup' action.

Alternatively, there is an 'On Update' action available in the properties for the raw serial driver. I believe this is executed whenever data is received on the port. I haven't used this method but you could possibly trigger your program from here (take out the infinite loop) and not need to waste a background task.
 
Thanks.

I will try these suggestions.
I captured the data and worse case seems to be 11 messages a second; but the rate is user settable, so could be 1 message a second or longer.
 

Similar Topics

Hey guys, hoping someone here could give me a little advice. I'm working with a CR1000-04000 in Crimson 3.1 and I was interested in adding the...
Replies
4
Views
97
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
1
Views
83
How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
103
Has anyone found a way to convert/replace/update the firmware on old Parker TS80xx series HMIs (i.e. TS8010, TS8006, etc) to accept Crimson...
Replies
0
Views
88
Has anyone setup communications with Red Lion 3.0 MODBUS to Baker Hughes Centrilift GCS VFD? Thanks
Replies
0
Views
86
Back
Top Bottom