02-16-2011 02:45 PM
Please post your most recent code.
02-16-2011 02:49 PM
here's the most recent vi
02-16-2011 03:42 PM
Well, you have a number of problems with that VI.
02-17-2011 01:43 AM
Your wait will occure after the read due to LV optimization, what you need to do is place a single frame Sequence which contains the wait in between write and read.
Now you'll write and read during the same microsecond before the VISA buffer is even filled (thus you get 0 read) and then wait 2 sec.
/Y
02-17-2011 08:02 AM
@Yamaeda wrote:
Your wait will occure after the read due to LV optimization, what you need to do is place a single frame Sequence which contains the wait in between write and read.
Now you'll write and read during the same microsecond before the VISA buffer is even filled (thus you get 0 read) and then wait 2 sec.
/Y
Y,
Where do you see this in the latest code that was posted?
02-17-2011 09:30 AM
02-17-2011 11:20 AM
So I got the program to run smoothly, except for one problem. The hot plate turns off between readings now and i'm not sure how to fix this? is it because i removed the while loop so it isn't polling anymore?
thanks!!
02-17-2011 11:22 AM
forgot to post the new vi, sorry lol.
here it is
02-17-2011 01:40 PM
nevermind, it's because i have the for loop instead of the globals,
i was just wondering though if there was another way i could do this without using globals? would i use an enum instead?
02-17-2011 06:43 PM
I would highly recommend you look at examples using state machinies. Your code is very difficult to read as well as it is extremely inflexible. What you have essentially written is a series of flat sequence structures disguised as For loops. You generally place the event structure inside a while loop so it can catch more than a single event. If you use a state machine you could would be able to have a more flexible implementation of your application, it would be MUCH easier to understand, you could catch and handle errors when/if they occur and benefit from using shift registers to pass data between the states (i.e, replace the use of globals).