LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plotting sinewave in graph using visa read

Dear All, 

 

I would like to plot the sinewave output from the agilent 33xxx in realtime. I was using visa read in combination with fract/exp string to number for that, but the chart shows only the value zero. 

I would appreciate it a lot if anyone can give me a hint. Attached is an image of the block diagram.

 

kind regards,

Daniel

 

0 Kudos
Message 1 of 9
(2,716 Views)

Add string indicator and see what you get from VISA

0 Kudos
Message 2 of 9
(2,714 Views)

When I add a string indicator to the visa read output, it stays 'grey' on the frontpanel. 

0 Kudos
Message 3 of 9
(2,709 Views)

Try hex mode.
If it still grey, so, you get no data from VISA

0 Kudos
Message 4 of 9
(2,697 Views)

if the string indicator stays "gray" it surely means you haven't received anything, except perhaps for control characters.

you could verify by adding a string length function in between,

or right click on your string indicator and choose '\ Codes Display' to see all characters including unprintable ones.

 

regards


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 9
(2,692 Views)

Post the actual VI and not just a picture.  I have no idea what's in the other case, for instance.  I suspect your elapsed time isn't wired up correctly and you never get the true case.


Edit:

Hang on, easy enough to reproduce the bare basics.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 9
(2,680 Views)

This is all you need to get the elapsed time to work.  No need to check for time diffs - the elapsed time VI will do that for you.  🙂Capture.PNG

(I hooked up the Time has Elapsed output to the Conditional Terminal for a convenient exit.  Hook up your stop button to it instead, and you will see that the Time has Elapsed goes TRUE, wraps around to the Reset input and resets the timer!)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 9
(2,671 Views)

Thanks for the replies. However, there should go something wrong in the read function. When I run the VI without the read function the programm works fine; it alternately switches on/off two function generators. When I connect an external oscilloscope a nice signal comes out. However when I start implementing the Visa read function and connect the string indicator stays grey from the beginning. What am I doing wrong here?

0 Kudos
Message 8 of 9
(2,645 Views)

there are several possabilites i see in your code

- you open VISA, but nowhere do you specify baudrate, termination character, timeout, .... - are you sure this works? as in ... are labview's defaults the same as your device's?

- you should only read from VISA when your "Enable Output.vi" got the TRUE, otherwise i think there is nothing to read from the device and the VISA-read function errors because of timeout.

- i'd recommend to track the state of the TRUE/FALSE input for "Enable Output.vi" so you don't try to set it each iteration, but only when a change occurred. depending on what is in there (you didn't attach it) there could also be a conflict with the VISA-read.

 

the way to troubleshoot is, doing everything by hand, not automated in a loop.

but several steps in one VI and confirm, that you get data from the VISA-read,

after that you can try to implement your automatic on/off read/no-read loop

 

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 9 of 9
(2,637 Views)