06-01-2016 10:22 AM - edited 06-01-2016 10:25 AM
Hi guys,
FInally got recognized my GPIB tool into labview, thats nice. I've created the block ( attached you can see te diagram ) but it works like 20 sec. I press continious run and i can change values in live mode, as i want. But then after 10 secs it appears the error that is in the screen and only working again if i reboot the Function Generator.
The model is Tektronix AFG3102.
Regards
Solved! Go to Solution.
06-01-2016 11:00 AM
1. Do not use the Run Continuous. That just creates nightmares when it comes to instrument control, even when debugging. Use a loop instead.
2. You need to initialize the connection and close it. Both of those should be outside of your loop (open before and close after)
3. You are likely sending the commands too fast. The instrument is likely getting locked up due to the massive influx of commands.
I recommend you use a loop with an Event Structure in it. Then you only send the commands when you actually change something.
06-01-2016 11:19 AM
Understood, but... i dont really know how to fit the event structure. Can you help me a little bit. Already seen a tutorial, kinda dunno what to do
06-01-2016 11:26 AM - edited 06-01-2016 11:27 AM
Stuck right here
06-01-2016 12:02 PM
You would have a separate Event "Case" for each button, for instance, to adjust Amplitude, you would have a single case in your event structure for "Amplitude, Value Change" and inside that case you would drop the Amplitude control and wire it to the TEK amplitude API function you have from your driver set. Same goes for all the other functions, but you would Initialize outside of the event structure, then pass that resource name through to each event in the structure, and out of the structure to a Close.
06-01-2016 12:05 PM
Also, no need for the Timeout case here. And where is your loop?
06-01-2016 01:01 PM
I am in the right direction? Brodught me time out error 😞
06-01-2016 01:08 PM
You need to put that VI at the bottom of your while loop inside the event structure, otherwise it will only run when the loop is first entered. For something like this I'd normally recommend you have a Type Def of controls considering there's many of them, and then parse through them within your VI but that may be a bit difficult. So copy and paste that VI at the bottom STDWFM and just pass the reference out from the itialize (you don't need VISA resource name out 2 indicator, delete that) and the output of STDWFM for Visa Out should be wired to the terminal like you currently have it, except change it to a shift register..
06-01-2016 01:13 PM
And you still need to move your initialize to be BEFORE the loop and your close AFTER the loop.
I would have 1 event case for all of the controls and call the VI inside of that case. Then you can wire the terminals directly to the VI inside of the case structure and you will always have the latest values for those settings.
06-01-2016 01:23 PM
Guys, i really appreciate your help. This **bleep** is really disturbing me.
I don't know if i am closer or even more far...
Regards