From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

rs232 data input

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.

 

 

0 Kudos
Message 1 of 7
(6,612 Views)

What data do you want out of the string? That's what's important. Then we can tell you how to parse it.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 7
(6,605 Views)

Ultimately I am looking to sort out the 2 channels that have the data in them , the 20.8 and the 21.5.

0 Kudos
Message 3 of 7
(6,598 Views)

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.

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
Message 4 of 7
(6,589 Views)

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.

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 5 of 7
(6,585 Views)

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?

0 Kudos
Message 6 of 7
(6,540 Views)

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.

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 7 of 7
(6,455 Views)