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: 

HELP with Scan timestamp from string

Solved!
Go to solution

Hello all,

I'm having a little problem here. I already have a text file with statistical data and I need to synchronize it with other data. For that, I want to put time stamps on each row of the data. Right now I have date/time in format 07/04/12 9:05 p

 

timestamp code labview.png

 

timestamp code labview error.png

 

 

So you can see on the printscreen image what I'm trying to do but when I run the code it gives me an error 😞 Please, help me. I've been trying to look for mistakes but I cannot find any yet. Maybe you can see what I'm doing wrong?

0 Kudos
Message 1 of 13
(3,877 Views)

it is your scan from string format constant...

0 Kudos
Message 2 of 13
(3,867 Views)

apoc, what should it be? From what I've seen it seems alright. Can you tell me specifically what is wrong with it?

0 Kudos
Message 3 of 13
(3,862 Views)

Well I can see that the string formed is "06:08:00 P*07/04/12" (without quotes)...
-> shouldn't it be PM instead of P*...

-> And there should be space between PM and Date (07/04/12)

 

So if you try to parse "06:08:00 PM 07/04/12"... there is no error...!!

 

If at all you have any other error, you should post your VI along with the data file.... or much simply can you copy&paste the string input at "Scan from String" node...??


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 13
(3,859 Views)

@moderator1983 wrote:

Well I can see that the string formed is "06:08:00 P*07/04/12" (without quotes)...
-> shouldn't it be PM instead of P*...

-> And there should be space between PM and Date (07/04/12)

 

So if you try to parse "06:08:00 PM 07/04/12"... there is no error...!!

 

If at all you have any other error, you should post your VI along with the data file.... or much simply can you copy&paste the string input at "Scan from String" node...??


This is the probe result of the input string to "Scan from string" : 06:08:00 PM 07/04/12

The asterisk is there because Labview just shows the beginning of the string, I guess. I'm out of explanations for this one, thought I might find suggestions here.

0 Kudos
Message 5 of 13
(3,849 Views)

 


@DanaSh wrote:
This is the probe result of the input string to "Scan from string" : 06:08:00 PM 07/04/12

Can you send that probe's result alone...!! may be enclose it in Quotes or parentheses...!!

Because when I tried parsing "06:08:00 PM 07/04/12"... there was no error...!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 6 of 13
(3,846 Views)

Check it here...!!

 

Working.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 7 of 13
(3,836 Views)

@moderator1983 wrote:

 

Can you send that probe's result alone...!! may be enclose it in Quotes or parentheses...!!

Because when I tried parsing "06:08:00 PM 07/04/12"... there was no error...!!


probe timestamp.png
here you go

 

 

0 Kudos
Message 8 of 13
(3,833 Views)

@moderator1983 wrote:

Check it here...!!

 

Working.png


I'll try to run it on a different computer. Seems like it's not the problem with the program then

0 Kudos
Message 9 of 13
(3,829 Views)

Cannot you copy and paste the string right here...!!
attaching screenshot will not help me getting the exact string...!!

 

And have you tried my code that I've attached in my previous post (as snippet)..??

or may be you cna copy the data from LabVIEW probe (#23)... and try running it in separate code.. and you should not get any error...!!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 10 of 13
(3,828 Views)