07-24-2018 09:05 AM
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
07-24-2018 09:18 AM
Add string indicator and see what you get from VISA
07-24-2018 09:25 AM
When I add a string indicator to the visa read output, it stays 'grey' on the frontpanel.
07-24-2018 09:29 AM
Try hex mode.
If it still grey, so, you get no data from VISA
07-24-2018 09:33 AM
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
07-24-2018 09:55 AM - edited 07-24-2018 09:56 AM
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.
07-24-2018 10:06 AM - edited 07-24-2018 10:12 AM
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. 🙂
(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!)
07-27-2018 03:36 AM
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?
07-27-2018 06:00 AM
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