LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error input write to text

i am trying to write to text and i have am using the concenate strings function and then using the resultant string as an input to the write to text and i continue to get an error saying that an input parameter is invalid. i'm not very familiar with strings and string functions. attached is my vi. if anyone has any suggestions or could help at all i'd greatly appretiate it.

also how do you format write to spreadsheet so that one column shows the time and the other shows the data? i looked in labview help and tried to use the formatting codes (%T etc.) but all that shows up on  the spreadsheet is the %T or whatever i specified.

Thanks so much
0 Kudos
Message 1 of 5
(3,111 Views)
Hello
i could not open your vi but this attached vi i think shows how to deliminate text with tabs (you need to use the LabVIEW tab constant in the strings menu) as well as how to write text to a file.  it will write to C:\Data\Example.txt , you can change the string to write wherever you want though
hope this helps
-Steve
0 Kudos
Message 2 of 5
(3,101 Views)

I'm sure there are legitimate reasons that NI created the dynamic data type but the use of it can really cause some problems. Your program is one example. You are doing a comparison of an array of data (the result of the DAQ Assistant reading N channels) and the result of that comparison is wired to your Mask and Limit Testing. All you are passing to the Mask and Limit Testing is a single Boolean or maybe an array of Booleans. You then wire the dynamic data to the Write to Spreadsheet File. The Write to Spreadsheet File function is designed to only write a 1D or 2D array of DBLs. The Write to Measurement File is the correct function to use with dynamic data. If you were to convert the dynamic data out of the DAQ Assistant to a waveform data type (the actual type of data being returned) with a Convert from Dynamic Data function, you would not get the automatic conversion that the dynamic data type provides and see some broken wires.

I have not run your VI but if you continue to get an error after making the above changes, could you try to determine where the error is occuring?

0 Kudos
Message 3 of 5
(3,095 Views)
I am now using the write to measurement file and it helps but i know am getting a new error signal. it says error 100 occured at write to measurement file Possible reason(s):

LabVIEW:  File contains erroneous data. Normally for user data files.

do you have any idea what this means or how to solve it? also for the measurement file, it records time as time elapsed since vi began running. how can i change this to the actual date and time of acquired data??
here's my modified vi to check out.

thanks for your suggestions.

0 Kudos
Message 4 of 5
(3,091 Views)

I don't have the hardware but I can run the VI in simulation mode and cannot reproduce the error. Do you get the error consistently?

As far as the date/time, the start date and time are written to the header. If this is unacceptable, you could try one of the other high level file write functions such as Export Waveforms to Spreadsheet File, you could modify the Write to Measurement File (right click and select Open Front Panel), or you could go back to the way you were doing but clean up the data types. In order to write date/time with the Write to Spreadsheet File, you would need to modify that as in LabVIEW 8.0, the function does not write strings. There are instructions to do so on the block diagram.

p.s. Spend a little time and clean up your diagram. The convention is that data flows from left to right. Your DAQ Assistant should be over on the left side and the data should move to the Mask and Limit Testing (which is still used incorrectly) and the case structure. You have the wires going backwards.

0 Kudos
Message 5 of 5
(3,086 Views)