LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing LV program to communicate with ADAM-6017 using Modbus TCP/IP

Solved!
Go to solution

Make sure you have a file name in the file path control, otherwise it will ask you for a path every iteration.

 

Right now the subVI that writes the header is working in parallel with the while loop, so you have no control over which happens first.  Take the path output from the subVI that writes the header and wire that to the shift register.  That way you know it completes before the while loop begins.

 

For timing, it is difficult to rely on Windows time.  It generally doesn't have good resolution.  I find about every .016 seconds.

 

Try formatting the time to a string.  Format the array of data to a string.  Combine them into a string array before writing to the file.

Message 11 of 17
(773 Views)

Would it be more accurate if I just counted elapsed time? I do not need the exact time/date just the time of acquisition. Do you have any recommendations for counting elapsed time?

0 Kudos
Message 12 of 17
(753 Views)

Sorry for the second post, but I figured out how to make everything into a string! But there is an empty row between every entry. How do I eliminate this row and why is the time not changing? Should I be getting the time out of the loop? Thank you for your help.

0 Kudos
Message 13 of 17
(744 Views)
Solution
Accepted by hollyhue

Don't mess with the time manipulation stuff.  You can format that into a string.  It thing what is happening is that you are coercing the data to a double, and don't have enough resolution in the data type for the nearly 4 billion seconds since 1/1/1904.  So the time gets coerced to roughly the same values.

 

Also, you hadn't cleaned up the file path for the header before.

 

I took the time, and the data, and formatted them all into strings.  Then built the array to send it to the "spreadsheet" file.

Message 14 of 17
(737 Views)

Wow, this is exactly what I need. I really appreciate all your help and patience! Sorry about my LV ignorance -- hopefully this will help me learn! Thank you.

0 Kudos
Message 15 of 17
(715 Views)

One more quick question... if I wanted to 'break-up' the double (see output below) from the rescale subVI such that I could display indicators for each of the 8 channels on the Front Panel in different locations (i.e. like on a schematic of the system I am data logging), how would you do that? Is there a way to create indicators indexed to different parts of that array?

hollyhue_0-1593107479989.png

 

 

 

0 Kudos
Message 16 of 17
(695 Views)

@hollyhue wrote:

One more quick question... if I wanted to 'break-up' the double (see output below) from the rescale subVI such that I could display indicators for each of the 8 channels on the Front Panel in different locations (i.e. like on a schematic of the system I am data logging), how would you do that? Is there a way to create indicators indexed to different parts of that array?

hollyhue_0-1593107479989.png

 

 

 


Of course.  You actually included the words to the answer in your question.  Index Array.  Note you can drag the bottom border of it downward so you can access multiple elements from the same function.  If you don't wire up the indices, you'll get index 0, 1, 2, 3, .... by default.

 

I think you'd benefit if you took some LabVIEW tutorials.

How to Learn LV

 

 

0 Kudos
Message 17 of 17
(678 Views)