07-22-2011 03:33 AM
Hi,
I want to convert date/time in string format to timestamp format (Using Labview 7.0). For this i m using scan from string tool and wired the format string but its not able to connect the output. I have attached the vi.
Kindly help me to correct the error
Regards,
Ratna
Solved! Go to Solution.
07-22-2011 03:46 AM - edited 07-22-2011 03:54 AM
Can you save the VI with some typcial data set as default in the array?
Technically it should work if your strings are in the right format (HH:MM, dd/mm/yy).
07-22-2011 03:47 AM
Hi,
This is happening as you are wiring the wrong values into the concatenate string function. Check the image. Make the first element from index(0,0) and second element index(0,1). Then it will work as you want.
Regards,
Nitzz
(Give Kudos to good Answers and Mark it as a Solution if your problem is Solved;))
07-22-2011 04:11 AM
hi,
I tried the same but still its not working. Plz......:womansad:.. help me or give me other idea to convert date time string to timestamp format.
Regards,
Ratna
07-22-2011 04:16 AM
Your VI still does not contain any default data. Without knowing how your strings are formatted we're pretty much fishing in the dark.
Make sure the array has some typical data in it, then go to Edit > Make current values default. Then save the VI.
07-22-2011 04:23 AM
hi,
sorry earlier i forgot to do that.
07-22-2011 04:31 AM
I don't know how Nitzz had this idea of changing the indices without seeing any data, change the array indices back to the initial values, they were correct.
I get the correct time stamp. Of course you're only reading the first element, you'd have to put all in a for loop to get an array of timestamps if this is what you expect.
07-22-2011 05:06 AM
hi dan,
i tried a lot as u said but still i m facing the same problem. Can u plz....post the vi in lv 7.0 or the complete image having for loop changes bcoz i might b making some minor mistakes. Also, 1 more question, do i need to set some timestamp setting in scan from string tool bcoz its also giving me error of too many format specifiers.
Thnks
07-22-2011 05:06 AM
Hi dan_u,
I didn't get a sample data from him, so i generated it using a "get time stamp" function and then tried to run it. It was running fine. There was nothing wrong in the code. But i had passed the value as Time in the first column and Date in the second. So the values which were coming in the output were wrong. Don't know why, i got this feeling that even he must be getting the same error and posted my previous post.. Hope you wont mind..To be honest, I was a bit careless while sending it.
Warm Regards,
Nitzz
07-22-2011 05:28 AM
Here is my solution, let me know if it works.