LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with execution of program

hi
      i am facing some problem with execution of program.i am not sure what is the reason for that.When i execute my program with ,highlight execution (the yellow bulb on the block diagram menu bar which when show the execution of program),  i am getting correct output .But when i turn off highlight execution button and run the program again i am not getting proper output.i am unable to understand problem.let me give brief idea of program.
      The VI i am running is for temp controller,it has 5 diff blocks.temp,read,write,run and standby. temp reads present temperature from the device when i send command X01(specified in manual of device) and i have not prob with the output with this.The only problem is with read block.here when i send command R01 to the device it should give me set temperature (which is diff from present temp).i am getting correct reading when i run Vi with highlight execution on but withou highlight execution on its giving output as zero
plzz suggest me wt to do.i am attaching my program with it.
thanking you
naveen
        
0 Kudos
Message 1 of 3
(2,544 Views)
I can't look at your code, but I can tell you that when the program works only with highlight execution it is almost certainly a matter of timing. Since you are apparently using serial communication the most likely cause is that you have a serial timeout which is not long enough and does not let you read the data in time. Either place a wait after writing and before reading or increase the timeout, so the device will have time to respond.

___________________
Try to take over the world!
Message 2 of 3
(2,532 Views)
This is definitely the case. You are writing a command to your instrument and then immediately querying how many bytes are at the serial port to be read. This value will most likely always be zero, because you're instrument hasn't returned the data yet. You need to insert a delay before you check how many bytes are available to give your instrument time to process the command and return the data. Tst was absolutely right.
Jarrod S.
National Instruments
0 Kudos
Message 3 of 3
(2,500 Views)