LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using User events on RT target

I have coded a driver (set of dll calls using CLFNs) for a 1553 bus controller. This is now being ported to real-time drivers. Some of the samples that ship with the drivers use the PostLVUserEvent() function to respond to interrupts registered on the hardware. Obviously this is not deterministic, since the samples are the same as the windows samples, none of the samples are deterministic, ...

The idea is to use front panel communication to have the host PC display (or initiate) the bus messages, but have the bus monitoring/control take place on the RT target. So given that the RT target's functionality is not deterministic, I guess more from an OS perspective, can I even use a function like PostLVUserEvent() on an RT target?

 

thanx,

lmd2 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 1 of 6
(3,266 Views)

Hi lmd2,

 

To start, I have a couple of housekeeping questions for you. In what language did you write this driver? What environment did you use to develop these drivers? Are you using LabWindows/CVI? When you say that "the idea is to use front panel communication to have the host PC display (or initiate) the bus messages", do you mean that you do not plan on building this into a real-time executable to run on a real-time target headlessly?What real-time target (some PXI controller, I'm assuming) are you using?

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 2 of 6
(3,243 Views)

we were not thinking to make these distributions (real-time executables) because they are samples to be distributed with the driver VIs.

the original DLL was writen in Visual Studio and that was the source for the LabVIEW drivers. We are using CVI to do the real-time port.

 

 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 3 of 6
(3,227 Views)

I should add that the real-time drivers will also be made available as LabVIEW 8.6.1 VIs (that's what we are shooting for).

When I coded the original LV drivers I needed to make some helper functions for doing malloc, calling the native function PostLVUserEvent(), and a linked-list input to the hardware - still working on porting this over to RT

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 4 of 6
(3,225 Views)

Hi lmd2,

 

To go back to your original question, user (programmatic) events are supported in real-time. However, I am not sure how this would translate over to a text-based environment, specifically using the PostLVUserEvent() function.

 

When you say that the original DLL that was written in Visual Studio was the source for the LabVIEW driver, do you mean that you are simply using a Call Library Function Node to call into that DLL? Do you do anything else in LabVIEW itself?

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 5 of 6
(3,185 Views)

Hi Aaron

The origin DLL exposed about 245 C-functions for interfacing to several families of bus controllers. A corresponding LV VI was coded for each of these functions, for 90% of them a simple CLFN wrapper was coded. But some of the C functions took as inputs, data types not supported in LV (at least LV 7 where the original dev took place) these included inputs of linked lists, pointers to pointers, allocating memory for data packets, and pointers to other C functions. I wrote a helper DLL to act as a 'bridge' for these cases.

 

Once all the low level functions were coded, we coded examples using the functions to accomplish some typical bus-monitoring type tasks - some of these were a bit involved - and I used PostLVUserEvent() to handle hardware interrupts at the application level, and the reference to the user event is a required input for the low-level interrupt functions.

 

The latest word from the client is that everything seems to have compiled - now lots of testing to see what works.

 

thanks for your help - I'll post something whether this works or not so you know how we made out.

 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 6 of 6
(3,178 Views)