LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Format date/timestring function able to control the loop execution of a VI?

Solved!
Go to solution

Can Format date/timestring function able to control the loop execution of a VI?

Example,

a VI is currently running at 25 August 2010 and print a txtdata "100825"

follow then when the system time running at 2359hrs, 25 August 2010 changes to 0000hrs, 26 August 2010.

and to print a txtdata "100826".

 

how ?

 

when the system time changes a new date, problems occur.

0 Kudos
Message 1 of 16
(2,742 Views)

Hi ADXING,

 

???

You want to control a loop iteration with a function that converts a number (timestamp) to a string? What exactly do you want?

 

You may compare the string generated by FormatDateTime with a previously generated one (using a shiftregister) - then you would get a boolean output to stop or continue a loop...

 

"when the system time changes a new date, problems occur."

Well, my computer runs fine, even for longer than one day Smiley Wink What kind of problems do you see?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(2,735 Views)

something like a loop iteration with a function that converts a number (timestamp) to a string

as u mentioned.

 

running non-stop...

prints dates...

auto update new dates when the system dates changes...

0 Kudos
Message 3 of 16
(2,727 Views)

Hi ADXING,

 

and where's your problem? Do you want something like discussed here?

 

There's a function for what you need...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 16
(2,722 Views)

sure..thanks.

step 1. when VI runs, its auto generated a folder with the PC system date (e.g. 100825) means August 25, 2010. Done.

step 2. as the VI still runs, the PC system date reaches 2359hrs, August 25,2010 and changes to 0000hrs, August 26, 2010. Done.

step 3. as the PC system date changes the new date - August 26,2010. I wan a NEW folder auto generated (update NEW) with the PC System date ("100826). Fail.

 

means total with have 2 folder created.

1st folder with a folder name: 100825

2nd folder with a folder name: 100826

 

this sequence to keeps running and NEW folder will auto generated (create) as a new date reaches of the PC System date.

 

 

 

0 Kudos
Message 5 of 16
(2,710 Views)

Hi ADXING,

 

see my message 2: compare new date with old date, when date changes you have to create a new folder. Simple as it is...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(2,707 Views)

any better simple example pictures to show?

kind of dn really understand what it means..

hmm...

0 Kudos
Message 7 of 16
(2,697 Views)

Hi ADXING,

 

see the simplified (not yet runnable) example VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 16
(2,692 Views)

oh..

hmm... where can i specified the created folder to save at?

a directory?

0 Kudos
Message 9 of 16
(2,687 Views)

Hi ADXING,

 

well, I wrote "simplified" and "not yet runnable"...

 

You have to wire a folder path to the CreateFolder function. There is a BuildPath function in the file palette...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 16
(2,685 Views)