06-26-2024 03:56 AM - edited 06-26-2024 03:57 AM
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:
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:
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?
06-27-2024 09:58 AM
you write busiless logic inside event handler, that just show you level as programmers.
I suggest you to start computer science 101 on youtube
06-27-2024 05:36 PM
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.
06-28-2024 02:02 AM
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.