Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Time based data logging in VBAI

Hi,

I made a little research and suprised to could not find anything which mentioned this.

In Data Logging step I can not use the time based variables like current time or inspection start time as a file name although those are in the list. When selected, getting a warning about invalid file name.

I guess it may be caused by colons in the time format, and it is not supported as a file name.

Am I wrong or will there be an implementation to solve this?

 

0 Kudos
Message 1 of 5
(2,995 Views)

Hi Sevincom,

 

In that drop down, we just enumerate all of our system variables and don't pre-filter the list.

 

The only way that you could log the files with names that contain time or date information, that was before invalid, would be to create an inspection variable (or network variable), set the variable to the system variable that you are wanting to log (ex: Inspection Start Time), and then run a VI from VBAI that accesses the variable using the VBAI API, programmatically replaces invalid characters, and then writes back to the variable. You would then be able to use the edited variable to name your logged data. 

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

0 Kudos
Message 2 of 5
(2,947 Views)

Hello Grey,

 

Thank you for the answer. I am already using a similar way, maybe more easier. I manipulate the format in the calculator step and use this value.

 

Both of these are just a workaround and decrease the performance unnecessarily so I was just checking to see if an improvement could be made.

0 Kudos
Message 3 of 5
(2,944 Views)

Something else to be aware of is that if you choose the multiple file option, it will automatically add a timestamp to the name. Try this out and see if this meets your needs for ease of use and including a timestamp in the file name.

 

Hope that helps,

Brad

0 Kudos
Message 4 of 5
(2,936 Views)

Brad,

It is a good advise but does not work as I require.

When I choose every 1 day option, it creates a timestamp like this: 2017-03-02 00.00.00.000

I need more like this: 2017-03-02 17.12.49.300

What I am trying to do is create at least one file every day, and create a new file every time the VBAI(or computer itself if possible) restarts. This is exactly the definition of Device Start Time variable.

Anyway, the calculator step seems to be the best solution for now, but an improvement could be made I think.

0 Kudos
Message 5 of 5
(2,930 Views)