NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Koaxial1
Posts: 6
0 Kudos
Accepted Solution

How to parse comma delimited data?

Hi!

I have a problem while parsing comma delimited data. My oscilloscope transfers 1002 data points via the RS232 interface which are comma delimited. In addition they have a variable length where positive values have 8 bits and negative ones 9. So parsing with a fixed length is hardly possible. I tried a variety of solutions for the measurement format like a\x2C but with no success. I can see the data in the RS232 monitor but how can I work with it in the Dasylab sheet?

 

Thanks for your help!

Active Participant
CJ_Butler__DASYLab_Pro
Posts: 737
0 Kudos

Re: How to parse comma delimited data?

a\x2c  (note the case) should work.

 

 

- cj
Member
Koaxial1
Posts: 6
0 Kudos

Re: How to parse comma delimited data?

Already tried it this way. My problem is that the RS232 shows the correct value in the monitor mode but it won't transfer the values to any other module like the write module in the Dasylab sheet.
Active Participant
CJ_Butler__DASYLab_Pro
Posts: 737
0 Kudos

Re: How to parse comma delimited data?

How does the line terminate? 

 

It looks like it's finding the value in the monitor... as you said. How is the module configured? can you attach the worksheet or images of all of the settings.

- cj
Member
Koaxial1
Posts: 6
0 Kudos

Re: How to parse comma delimited data?

I tried to make some screenshots of the module. The worksheet itself is not of interest I think. The line ends with \r\n

Member
hw70
Posts: 33
0 Kudos

Re: How to parse comma delimited data?

The (output) timebase is set to 15 seconds ( < 1Hz) with bocksize 1002 -- this will take several minutes to fill a single block.

Active Participant
CJ_Butler__DASYLab_Pro
Posts: 737
0 Kudos

Re: How to parse comma delimited data?

For a test, reduce your sample rates to 1/second, with a block size of 1. You can use a Data Window module to recollect them back into a larger block if it works.

 

Additionally, if this does not work, try changing the INTERFACE settings for the hardware handshake to one of the three bottom choices (in English, they say "Without". These settings hold one or two pins high or low, for some devices that expect that. Try each one in turn, to see if it works. This is a common solution.

- cj
Member
hw70
Posts: 33
0 Kudos

Re: How to parse comma delimited data?

Another problem is, that the entire data record is terminated by \r\n, but the data values itself are seperated by commas.

The last data value (the one between the last comma and the \r\n) will stay in the buffer while DASYLab waits for the next comma to arrive - forever, or until someone resets the buffer (action-module).

Member
Koaxial1
Posts: 6
0 Kudos

Re: How to parse comma delimited data?

I tried all handshaking methods but that didn't help. I also tried a sampling rate of 1 s and a block size of 1, but allthough I have a bunch of data (1002 data points) in the RS232 monitor I only get one single value in a linked list module. This value does only change if I send another data request. I used the data format a\x2c. Any further ideas? I really need help with this.

Member
hw70
Posts: 33
0 Kudos

Re: How to parse comma delimited data?

What happens, if you move the data-request from the channel into the "Start-Kommando"-field, and deactivate the "active data-request"-option, too?

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page