LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem interpretation of data from serial data.... help please!

Hi CC,

I put again the case structure, since i need add the byte loss or forget only at the first reading of each 240 readings.... now runs ok.

To stop the vi, i try to put the reference of bottom stop to the subvi, but it doesnt run. Can you look at the problem?.

The global variable, i try to search examples but i dont understand...

Regards
0 Kudos
Message 21 of 57
(3,983 Views)
You didn't pass a reference to the sub vi. You tried to pass the control value. That could not work : Before running, the read serial sub vi has to wait until he receive all the info, and specially the value of the stop button. Means that the read serial was running only one time, AFTER you pressed the stop button !!!
Here is what you should have done...

CC
Chilly Charly    (aka CC)
Message 22 of 57
(3,969 Views)
Hi CC,

It is not working!!. I dont know why.. but the both vis continuing running when i stop to recieve data.

What is the other option?, global variable?... add it in my program..

Thanks.
0 Kudos
Message 23 of 57
(3,959 Views)
Hi CC,

I got run the stop the vis changing the bottom to 'switch when released'.
The vi stop when count 120 readings, if i want stop before it fauls.

I have a litle problem, i would like to put default values at all bottom and graph each time i execute the program, but in the graph i didnt get...

Can you help in thats?.
0 Kudos
Message 24 of 57
(3,950 Views)
Hi Fonsi !
To reinitialize a chart, just pass an empty array to the "History" property node.

CC
Chilly Charly    (aka CC)
Message 25 of 57
(3,944 Views)
Hi CC,

The last problems...

The vis runs ok, right now i use this vis in other main vi, which use differents vi, so i execute the the main vi (serial), open one window in my main program, the main vi serial, wait to me, since i have a bottom in the pic, when i push start, the pic send values and when i push stop the pic stop to send readings....
The normal thing, is the vi STOP when the timeout is passed, but this vis, have the for loop 120 values (i modified the pic to send the sync bytes each 120), then the vi continue other cycle of for loop very slow if it get to 120 then the vi say " time out error"...

Then when i execute my acquis. window, i can to have the bottom stop to send readings, and the program continue running, when i push start get values... this could be valid, althoght if it goes well, i only must to adjust the timeout... But the big problem is when i finish the acquisition. If i stop the data recieved with the bottom of vi, i push and maintain pushed until arrive to 120 the for loop, then stop to acquire data and close the window,later draw the data in my main program, it is not real time but is valid.
The problem is, when i am acquire the data, normally i stop the data with the bottom of pic,if i do that, the data stop to recieve but the vi continue running, since the serial vi, increase the counter of for loop very slow... until 120, when it arrives to 120 will stop the vi with error, when i stop to send data, the serial vi work, and when pass the timeout show M1=0 , M2=0, M3=0, but the counter of for loop goes incresing. its very bad!.

I tried, when i push close, in the main vi, the for loop would be = 0 , then the serial vi will be stoped , but is not run. I dont know why.
I need any structure, when i push stop in the mainvi, the serialvi change the constant value of cycle for loop to 0. Then will close in this instant!. Normally when i push the stop bottom in the pic, the serial vi, is lossed inside of for loop and its the problem.

Any advise in the vi?.
Charly thanks for your patiente with me! We are near to finish!.
The program is a lot of bigger, it is only the acquire data, the other part is all ok!. Before i used read from file, i saved the data with c++ program, and now i want real time acquire...
Regards, Fonsi.
Message 26 of 57
(3,935 Views)
Hi Fonsi !
A for loop cannot ber stopped before finish. Replace it with a While loop, and use an OR condition to stop it, either when the right number of loops has been run, OR when the stop button has been pressed in the main vi.

CC
Chilly Charly    (aka CC)
Message 27 of 57
(3,916 Views)
Hi CC,

Yep, i put while loop too, it improves than when i am sending values from pic, when i push stop in vi, the vi stop in this moment.
But, when i am sending data and stop the pic to send data, the program doesnt recieve data from pic but the vi continue running , i push stop but it doesnt stop, goes running...

Teoricall solution, it would be, when the serial read vi pass certain time doesnt recieve data STOP the vi!!.
It is the problem. Any solution?.

Regards,Fonsi.
0 Kudos
Message 28 of 57
(3,899 Views)
Hi CC,

I put the while loop, and add the status from serialvi, so i put if error in the line, i stop the while loop. At this moment, when i stop to send data from pic, the vi wait the timeout and close the vi. Ok, solved one problem.

But curiostly, right now, when i pressed the stop bottom in the main program, the subvi doesnt stop!. The subvi continueing running get data from serial port, I dont understand why. Can you help me?. I put one indicator in the reference from the stop main vi, and never is lighted!. I leave pressed the bottom and never light the indicator.

Regards,Fonsi.
0 Kudos
Message 29 of 57
(3,897 Views)
Hi Fonsi !

The Stop ref has to read in the deepest loop. Otherwise, you'll have to wait until the loops finish (or an error occurs) before being able to proceed the stop order.
Chilly Charly    (aka CC)
0 Kudos
Message 30 of 57
(3,890 Views)