NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Fun with C# API to DAQmx in TestStand - Sequence hangs completely

Hi Everyone. I am trying to use the .NET API for the DAQmx directly in TestStand. I was following the example from the shipped examples to figure out the exact syntax. I am trying to write value to a digital port, no big deal - that's why I thought I could just use the API and not bother with making wrappers in LV or C#.

 

I have noticed, that my TestStand hangs totally on "Create Channel". Termination does not help, nor does the Abort - after a while, I can only kill all threads in the execution.

 

Puzzled by this, I have tried to fire up the said example in Visual Studio - I got the exception in the same line of code, that said Access Violation - like this:

 

sw4sys_0-1719391909342.png

 

I must admit I have fired the example up in VS 2022, bumping the .NET Framework to 4.8. As for the DAQmx API version, I have tried this with several versions of the API:

 

sw4sys_1-1719392037210.png

 

I have also tried TestStand 2016 32-bit and TestStand 2022 32-bit to the same end - I doubt it's a version thing though.

 

Is anyone willing to shed some light on the matter?

0 Kudos
Message 1 of 4
(343 Views)

you write busiless logic inside event handler, that just show you level as programmers.

 

I suggest you to start computer science 101 on youtube

0 Kudos
Message 2 of 4
(301 Views)

Yeah, Konan that was very constructive... Now, take a look at community guidelines because apparently you don't know how this forum works.

 

https://forums.ni.com/t5/Using-the-NI-Community/NI-Community-User-Guidelines/ta-p/3698591

 

Also, learn what an example is.

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 3 of 4
(288 Views)

Hi,

 

If you read my post really, reeeally closely, you might notice that the code I am referring to is a *shipping example from NI*.

 

I also would prefer even a simpler one to start with, but I think it's possible to carve out the important bits out of the event handlers.

 

There is a good chance that this code is missing some handlers of the unexpected situations and a "production-ready" code should probably be a little more structured/defensive etc, but in case of a code example it would be an unnecessary sacrifice of the readability.

0 Kudos
Message 4 of 4
(264 Views)