01-21-2013 08:18 AM
Hello,
I am trying to read data into dasylab via Rs232, but I am new to dasylab and havent worked reading in rs232 data before.
I managed to get dasylab to communicate with my device, but I am having trouble parsing the data effectively.
In the rs 232 monitor, without sending any commands, I get a set of data in the format
DA 0 00 20.8 21.5 0.0 0.0<CR><LF>
I've been searching the forums and think this has a very simple solution, I'm just having trouble finding the correct command to put in the "measurement data format" box for each channel
Thanks for the help.
01-21-2013 08:33 AM
What data do you want out of the string? That's what's important. Then we can tell you how to parse it.
01-21-2013 08:43 AM
Ultimately I am looking to sort out the 2 channels that have the data in them , the 20.8 and the 21.5.
01-21-2013 08:50 AM
Ok, there are a couple of ways to do this
DA 0 00 20.8 21.5 0.0 0.0<CR><LF>
If the first three groups are constant, then use them as a search string to anchor the first data point.
Channel 0 will be
"DA 0 00 "a\x20
the \x20 is the trailing space, and delimits the data point.
Channel 1 will be
a\x20
If that's all you want, then the rest of the line is ignored, while it searches for the "DA 0 00 " for the next Channel 0 value.
01-21-2013 08:51 AM
DA 0 00 20.8 21.5 0.0 0.0<CR><LF>
If they are not constant, then just use the DA
Ch 0: "DA" 6x a\x20
Ch 1: a\x20
the 6x will skip 6 characters to start parsing at the 2.
01-30-2013 12:13 PM
CJ
I am revisiting this project and lookig to do some slightly different things with it, I have been able to parse out the other values fine, but one of the applications I am trying to implement is alarm sensing.
I know there are ways to make alarms in DASYlab, but the device I am reading from has its own alarms that I want to make a display for in DASYlab.
when one of these alarms occurs, the normal data stream is interupted by the line
Alarm code: x<CR><LF>
I set up an additional channel with measurement data format '"Alarm code:" a\r'
so far this has worked for collecting alarms when they occur, however no data from the other channels is collected until the alarm occurs. Is there a way to fix this?
02-12-2013 05:08 AM
You need to change the timing options for the module.
The default Option is to wait for all channels to release data.
In V12, change the Data Output Option to the first selection, Output every measurement value immediately.