NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Teststand 2017 trace.WriteLine

Hello all,

 

I'm using teststand 2017 32 bit and we create DLL's using the trace.writeline command to give info to the outside world.

When running the DLL using console (visual studio console proj) we get the info in e.g. debugview.

When we run the exact DLL using teststand, we don't see anything.

 

mark that using teststand 2014 we see the trace.writeline info.

 

Could someone please tell us how to obtain the trace.writeline info back in teststand 2017?

 

brgds

 

JCR

Message 1 of 7
(3,474 Views)

Dear Jeroen,

 

I tried your findings ... and indeed i see the same issue...

0 Kudos
Message 2 of 7
(3,449 Views)

Hi Jeroen,

 

Thank you for your post.

 

Please can you tell me how this is created? Also, can you share the source and code?

 

What other software (and versions) have you got installed (including .NET, LabVIEW, Windows)?

 

Kind regards,

YD

0 Kudos
Message 3 of 7
(3,390 Views)

Sure, 

 

we do e.g. :

DLL:

        public string Init(string ResourceName)
        {
            string read = "";
            try
            {
                Trace.WriteLine("-- FSC3 -- Enter Init Function");

                mbSession = (MessageBasedSession)rmSession.Open(ResourceName);

                read = Query("*IDN?\n");
                write("*RST");

            }
            catch (Exception Ex)
            {
                Trace.WriteLine(string.Format("{0} {1}", "Error when executing Init commands with device : ", Ex.ToString()));
                read = "Error when executing commands with device";
            }

            Trace.WriteLine("-- FSC3 -- Exit Init Function");

            return read;
        }

And in the test program we do:

 

            FSxxSpectrumAnalyzer FSC3 = new FSxxSpectrumAnalyzer();
            string IDN = FSC3.Init("TCPIP0::192.168.0.100::INSTR");

then we see it the output:

 

-- FSC3 -- Enter Init Function
-- FSC3 -- Exit Init Function

When we perform this function from the teststand:

 Untitled.png

 

 

we don't see anything in debugview. 

 

setup : Win 10 enterprise 64 bit, teststand 2017 32 bit. VISA, spectrum IVI (FSL3), visual studio 2017 pro, latest .net

 

when I try this out on a win 7 PC 64 bit, I get the trace in debugview.

 

 

0 Kudos
Message 4 of 7
(3,380 Views)

Hi Jeroen,

 

Thanks for sending that across.

 

I have a few questions:

  • When trying this code in TestStand 2014, has it been tried in both Windows 7 and Windows 10 computers? Does it work in both PCs when using this version? This will help me understand which TestStand versions have been used on which operating systems.

 

  • Please can you send a MAX report of both machines

Creating a MAX Technical Report to Document Configuration Information - National Instruments

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9mPSAS

 

  • Have you tried to run the code as Administrator? Windows 10 will often block commands if not run as admin
  • Try to disable the antivirus and run the code. The anti-virus can block commands.
  • You may have missing drivers on the new system.

 

Hope this helps

0 Kudos
Message 5 of 7
(3,373 Views)

Hi Jeroen,

 

Have you had a chance to try the steps I suggested in my last post?

 

Kind regards

0 Kudos
Message 6 of 7
(3,322 Views)

seqedit reroutes the tracing:

seqedit.exe.config contains:

<trace autoflush="true" indentsize="1">

        <listeners>

          <add name="TextListener"  type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Applprog\log\tstrace.log" />

          <remove name="Default" />

        </listeners>

      </trace>

 

delete it from seqedit.exe.config and the tracing goes back to e.g. debugview

Message 7 of 7
(3,162 Views)