Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Graphing of VISA serial data doesnt look like waveform

hi all,

 

im converting a analog signal to digital and sending through the serial port to graph in LabView. So far I can get/see the data coming in and what looks like the correct values on the graph.This is for DC values.  Problem is when is try sending a signal that changes , for example a sinwave it looks very undersampled or zoomed in. 

 

Can anyone make some suggestions....please thnx

Download All
0 Kudos
Message 1 of 4
(4,066 Views)

What delay are you using?  On your front panel, your control is set to 0.  So you have no wait and read the bytes at port which is probably 0 as it will take a little bit of time for the response to come back from the device after writing the "D" to it.

 

Does your device always send the same number of bytes after the "D" message?  Does the response end in a termination character?  If either of these are true, I would not use the Bytes at Port node, but request either the precise number of bytes you are expecting, or more than enough if you know you are getting a termination character.  Getting a lot of zero byte messages could really throw off the data stream and cycling of that loop.

 

Also, don't close your VISA Com port on every iteration of the while loop.  Place the VISA close after the while loop.  You should also wire up your Error wires.

 

A couple other questions.

Why are you using a feedback node of the greater than express VI back to the Write boolean?  Why are you using the dynamic data type?  You have quite a few conversions going on with a string going to an array of U8 which is getting converted to a dynamic data type.  Why use an Express VI for a basic greater than function?

 

Also, are you sure what the data stream coming back is supposed to look like?  How does the data you are getting supposed to be converted to real values?

I like the heart shaped boolean.
Message Edited by Ravens Fan on 09-29-2009 10:46 PM
0 Kudos
Message 2 of 4
(4,038 Views)

Ravens Fan,

 

thanks for the tips.....

 

I fixed the closing of the VISA Com port on every while loop iteration. I increased the delay to about 20. I had some questions and also wanted to clear up the device's response in all of this.

 

The VISA write of ASCII char "D" is suppose to trigger an interrupt on my microcontroller that triggers an alarm in my breadboard circuit. This write should only happen when any of the values received are 'too high' , or greater than some predefined constant. This write is working and activates the alarm... also the device does not respond back to VI for this write.

 

The device is constantly transmitting 8-bit bytes to the VI, the device should only be interrupted to activate that alarm. Anyway the data represents a heart signal that has gone through an analog to digital conversion.  my problem is the graphing of this data. i know you said something about the data type? can you suggest which one to use.

 

also there are no termination characters being sent to the VI. do you think this is a problem?

 

 

 

 

thanks, any help is appreciated

 

maldonado2933

0 Kudos
Message 3 of 4
(3,970 Views)

Since you did not provide an image of the front panel with data and no one else has your hardware, it's hard to know what you mean by undersampled or zoomed in. Perhaps all you are seeing is the effect of completely rewriting the graph each time you do a read. Why don't you use a shift register with a Build Array so that new data is appended to old. A chart instead of a graph is another option.

 

Since it seems you are streaming a series of hex values, you do not need a termination character.

0 Kudos
Message 4 of 4
(3,964 Views)