NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Write data to Text File generates error

Solved!
Go to solution

Hi All ,

I Need to write data into a file using TestStand and i configired the input and out as Below but i am getting error as "An error occurred calling 'Write' in 'ITextStream' of 'Microsoft Scripting Runtime' [Error Code: -2146828234] "

I have followed the same Procedure for Read Text which works fine for me.

Hope few others might have faced the problem/ or i may be doing something wrong.

Do Needful.

TestStand Write Error.PNG

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 1 of 6
(3,912 Views)
Solution

Problem found, While opening a file i used IO Mode as ForReading instead of ForWriting.

Unnecessarily thread created, but then hope this may help someone later when they face particular issue.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 6
(3,896 Views)

How can I get the Object reference of a Test file in TestStand?

You are using Locals.GTS__TAG_FILE local variable to give the File object reference. So, I think you should get the Text File Object reference and store it in this Local variable before.


Can you please share me how you got the Object reference of the Text file (Open a File) and Where you specified Write/Read Modes.?

 

Thanks and Regards,

Manikandan

0 Kudos
Message 3 of 6
(3,030 Views)

Create a Action Step and change the adapter in Properties-General tab to ActiveX/COM, and create a Variable with Object Reference as Type and map the same in the Module Tab (Object Reference).

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 4 of 6
(3,014 Views)

Hi Palanivel,

How do I assign a text file's object reference to this variable (that I created with type Object Reference)?

 

Thanks,

Mani 

0 Kudos
Message 5 of 6
(2,997 Views)

To Open File use this snippet information

 TS_CreateFileRef.PNG

 

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 6
(2,953 Views)