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: 

Periodic Commands, Periodic Timer

Hello All,

 

I am trying to develop a vi that used to send multiple commands through a serial port. The commands must be sent at a specified interval. Like Data 1 must be sent at interval of 250ms, Data 2 must be 2000ms, Data 3 must be 1000ms, and so on. I have developed the vi and inorder to check that vi I have added an incremental factor.

The incremental factor will be incremented by 1 based on which Data is triggered. For example, if the Data 1 is triggered at 250ms it will be added 1, so at every 250ms the value will be incremented by 1. The loop time is 100ms.

 

I am facing a problem, every time I run this vi the incremental factor for Data1 is increasing by 14 times.

I need to resolve this issue. I have attached the vi for your reference.

 

Expecting the positive response. Thanks in advance.

 

Thanks,

Karthik

 

0 Kudos
Message 1 of 2
(896 Views)

You've got a wait until next ms multiple of 100 in the loop, 250/100 = 2.5, (there is a remainder) Data1 will always mess up.
you need a loop timer that divides into all of your data times.
50 or 250 should do you. (I'd go 50) as you won't miss a 250 from there.

Then with your loop running faster than the smallest data time you determine if you need to send a signal.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 2
(882 Views)