From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lose time in my programm SOS!!!

hello everybody, i am doing a program to comunicate two pc,s running labview in both of them...

 

i am reading information for on csv file every 32ms, and every 1001ms i am sending the readen info to the other pc...

 

when i do it, there is no error but there is one thing that is wrong. when my program is sending the info don't read the information, so i read every 32ms and when ids the moment to send the information i have a delay of 15ms aprox. and my problem is that i can not lose or waste this time...

 

can somebody help me please??

 

i also put my program if you like to see it!!!

 

thank you!!!

 

happy 2012!

0 Kudos
Message 1 of 12
(3,033 Views)

Hi alan,

 

- it's quite challenging to read a file every 32ms again...

- you have timeouts in the queue functions, thus there will always be some kind of "lost time" in the queue reading loop!

- you (possibly) have delays in the datasocket functions

- Windows will hurt your realtime experience Smiley Wink

 

Due to all those reasons you will not have a "synchronuous" operation as desired!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 12
(3,028 Views)

and can i do it in other way to work better? no losing time????

0 Kudos
Message 3 of 12
(3,026 Views)

Hi Alan,

 

- use (more) separate loops for each task

- use TimedWhileLoops

- use a realtime OS

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 12
(3,023 Views)

well, i don't understand you when you say more separate loops??

 

timed while loop¿¿i have used it but i don't know how to implementate this to this program.

 

and finally i am using ubuntu and windows xp os

 

samething more, sorry but i am very new in labview, i think is very interesting program that have million of aplications..but i need help i am still lerning this!!

 

thank you!!

0 Kudos
Message 5 of 12
(3,016 Views)

any idea?






0 Kudos
Message 6 of 12
(2,989 Views)

In LV It's quite easy to run multiple threads, two separate while loops will run as two threads unless there's some wire depandancy. Use an Action Engine to store your data and you can use 2 loops, one for getting data and one for writing to file, which'll also reset the data cache.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 12
(2,972 Views)

sorry but i don't understand what are you saying me, i am new with this and i have lv 2009...can you give a simple example or something like this???

0 Kudos
Message 8 of 12
(2,959 Views)

Very crude example, you'll also need to look up Action Engine

/Y

Dual loop example.png

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 12
(2,944 Views)

but i havent got action engine in my labview!!

0 Kudos
Message 10 of 12
(2,941 Views)