LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

-10003 error @ Config_DAQ_Event_Message

I'm trying to use Config_DAQ_Event_Message to generate a message every N samples.
I'm using a PXI6030E board (designated device 8 by M&A), which is triggered through RTSI1.

I use the following inputs:
deviceNumber: 8
mode: 1 (add a new message)
chanStr: AI0
DAQEvent: 1 (Daq event 1; event every N scans)
DAQTrigVal0: 25 (I acquire a double buffer of 200 samples)
DAQTrigVal0: o (ignored)
trigskipcount, pretrigscans, posttrigscans: 0 (ignored)
handle: using the GetWindowHandle function in user32.dll (returns the handle to the active window); I "catch" the message in the same VI as where the AI is initiated
Message: arbitrary, but for this example 32000
Callbackaddress: 0 (not used)

I keep getting a -10003 error when
trying to execute this DLL call. When I use mode 0 (clear all messages), the execution is ok (error 0). Does anybody spot the problem?

Thanks,


Walter Tansini
0 Kudos
Message 1 of 7
(3,365 Views)
Hi Walter,

At a glance, I don't see that you're doing anything wrong. I've attached a CVI program that demonstrates how this works with a callback routine instead of the windows messaging. Perhaps you could 0 the message and the handle in your program and see if you can at least run the program that way. Then we can narrow down the problem further.

If you have further questions, please let me know in what environment you're programming and which application is returning the error.

Hope this helps.

Kristi Hummel
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,365 Views)
Hi Kristi,

I've tried to null the message and handle, but the problem remains the same. I've included a test VI. I'm running LabView 7 on a PXI 1010 chassis with a PXI6030E card in slot 8. I really hope you can help me out on this one.

Thanks anyway,

Walter Tansini
0 Kudos
Message 3 of 7
(3,365 Views)
Hi Walter,

Have you tried using the Daq Occurrence Config VI instead of calling the dll? In LabVIEW, go to Help->Find Examples and type "occurrence" in the Search tab. The program is called "Acq N Scans - Async Occurrence.vi" This VI is configured to generate an occurrence when the acquisition is complete. Then when the event occurs, the Wait on Occurrence vi ensures that AI Read is called to read the data sitting in the PC buffer.

You would use this similarly, only choosing to configure an event when you've acquired N scans. You'll notice the parameters are very similar to the Config_DAQ_Event_Message, except for the callback address and the windows handle and message. You then write the block of code you want LabVIEW to execute when Wa
it On Occurrence returns "true".

I hope this provides a good solution for you.

Kristi
0 Kudos
Message 4 of 7
(3,365 Views)
Hi Kristi,

unfortunately, no. I can not use the high level LabView VI's, because I need the pointer to the AI double buffer. The only way to get this pointer is to define it through NIDAQ DLL calls. As I can't combine the higher level VI's (which are Task ID orientated) and low level NIDAQ-DLL calls (which are device numer orientated) I am forced to set up my entire acquisition in low level DLL calls. It's a pity that NI chose to use the LVDAQ wrapper DLL for their NIDAQ calls, otherwise a hybride approach would have been possible.

You may ask why I need the pointer to the acuisition buffer. I need to read a segment of data every N samples, but also need that data in a circular buffer which will be something like 5N in size. I
is possible to use high level VI's, but that means I would have to create, fill and maintain my own circular buffer. This would mean extra copies of data and extra processor capacity, when all I have to do now is keep track where the data is written in the acquisition buffer en read the required segment.

So, sorry, we can't work around the problem. But I assume there has to be a logical explanation why I get the -10003 error.

Walter
0 Kudos
Message 5 of 7
(3,365 Views)
Hi Walter,

It looks like the problem was with your declaration of the function call in the call library node. You defined several of the arguments as pointers rather than simple data types. I've attached the revised version of your post.

Hope this helps.

Kristi
0 Kudos
Message 6 of 7
(3,365 Views)
I'll check it out first thing tomorrow when I'm back at work. But I'm already punishing myself for something that stupid. The function library calls in Labview never ever automatically sets the right definition of the variables. I must have overlooked the values/pointer items. Thanks anyway for the effort.
If there is still a problem (probably not) I'll let you know.

Thanks again. If you ever get to the Netherlands, the first round's on me!
0 Kudos
Message 7 of 7
(3,365 Views)