LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graphs problem

Hi M

if you look at the png file you will notice how the dataflow progresses !

In you diagram  in all cases you cannnot determine: if the serial port is written to OR if bytes at serial port functions first ?

Dataflow is undetermined!

You need to force the operation sequence: 1)write to serial port  then   2)bytes at serial port before following the next operation.

This is achieved by connecting error out terminal of write to serial port to error in terminal of bytes at serial port.


As you have developed you program you will never be sure of the output data.

xseadog
Message 11 of 18
(1,245 Views)
Hi Xseadog,


I am not sure what is png file. There is an error out from the serial port write.vi, but  there is no input for error in case of the Bytes at serial port.vi.
Also, I tried using flat sequence structure which will write to port in the first frame and then do all the remaining stuff in the next and final frame. I am not sure if that would solve the problem.

Thank you for  your time.

Regards,
Mozill
0 Kudos
Message 12 of 18
(1,234 Views)
Hi Mozill,

sorry  I meant previous gif file not png fileSmiley Surprised
if you open the gif file I attached ( see page 1)  you will notice how the serial port vi's ( visa) are tied together.

This means that the second VI cannot do anything until the first >VI has executed its commands!

In your serial port commands you have not stated what happens first! Thus the read could occur before the write, so you have the possibilty of re reading temperasture from previous cycle.

By ensuring dataflow flows left to right it is easier to debug. Make sure that the 'operation' occur in the sequence you wish and not what Labview deems !

Xseadog


Message 13 of 18
(1,229 Views)
Hi Xseadog,

I tried using a flat sequence structure which writes to the serial port in the first frame and does the remaining stuff in the nex frame. Are there any other specific ways to enable the serial port write followed by the bytes at serial port as you mentioned before. The error thing you mentioned does not work in my case because there is an error out in the serial port write.vi, but there is not error in the bytes at serial port.vi.

Any suggestions are appreciated. Thank you for your time.


Regards,
Mozill
0 Kudos
Message 14 of 18
(1,209 Views)
Hi Xseadog,

I tried using a flat sequence structure which writes to the serial port in the first frame and does the remaining stuff in the nex frame. Are there any other specific ways to enable the serial port write followed by the bytes at serial port as you mentioned before. The error thing you mentioned does not work in my case because there is an error out in the serial port write.vi, but there is not error in the bytes at serial port.vi.

Any suggestions are appreciated. Thank you for your time.


Regards,
Mozill
0 Kudos
Message 15 of 18
(1,210 Views)
Hi mozill

Check the attached gif file: please note a rough and dirty solutionSmiley Sad

xseadog

if you are familiar with state machines then use that option to create the same as the  frame sequence you were investigating


0 Kudos
Message 16 of 18
(1,199 Views)

Hi Xseadog,

Actually I drew the whole vi again with the flat sequence structure and wolla it shows the graphs....isnt that strange. I dont know what did do wrong before. I will check it on my hardware and let you know. Thanks a lot for directing me to use subvi's leading to better understandable diagram.

Just wanna know two more things as follows:

I wanna log the data which is taken in the graph at the intervals I am specifing in an excel graph. I know one of the method about using time stamp and concatinating it with the terminal going in to the graph and feding in the array to the file. But, is there any other efficient solution because I wanna create an option where the user can see the excel file when the graphing has been completed the vi is still running to perform other operations such as accessing the current temperature/himidity.

Also, I  am running graphs only if the current time is less than the target time. In order to do so, I am comparing two strings which probably I think is wrong if you look at my vi. Do you have any other suggestion for comparing a constant time/date with a varying time/data.

Thank you for your time.

Regards,

Mozill

0 Kudos
Message 17 of 18
(1,186 Views)

Hi Dennis,

In the attached program, I write '1' to the port to get back the info I read from the serial port. But , it seems that the stuff I am reading at the indicator of the serial read is not the one I requested as soon as I write '1'; its the previous info present at the serial port. So, in short, everytime I read the past information, not the current one which I requested.

 

Any help is appreciated. Thank you for your time.

 

Regards,

Mozill

0 Kudos
Message 18 of 18
(1,142 Views)