Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create Hardware abstraction layer

🙂

Well now i have one more question about init real HW. How to implement real HW concrete DAQmx. I don't understand where I must implement adress of sensors or valve. Because NI support told me that initialize channel before launch Actor and stop channel when actor stoped.

I am confused because my cylinders have different count sensors and valves. Also different count addresses

I don't know how to create dynamic dispath because dynamic dispath must have same connector panel with input and output.

0 Kudos
Message 21 of 25
(1,292 Views)

I'm not sure, what you mean with addresses. But... I guess the answer is "use arrays". This would probably be the simplest form. But their are alternatives like variants, flatten string etc. But I'd recommend you to go with the arrays for the beginning.

Again... If you take a look at the example I send, you will realize that sensor sends an array to controller. This array would have 1 element for "1 sensor" objects, 2 elements for "2 sensor" objects and so on. It's the same for the cylinder. Controller sends an array with one element to monostable cylinder and two elements to bistable cylinders to control the valves.

0 Kudos
Message 22 of 25
(1,292 Views)

Every DAQmx chanel has adress. Dev1/port0/line0. Configure DAQmx or some real HW.

0 Kudos
Message 23 of 25
(1,292 Views)

I think those are mostly considered as channel names... either physical or virtual. You can use colon for a series and comma for a list. Look here for examples:

http://digital.ni.com/public.nsf/allkb/9A2AF5E10E0C893386256FE8006807DF

0 Kudos
Message 24 of 25
(1,292 Views)

reteP wrote:

Because NI support told me that initialize channel before launch Actor and stop channel when actor stoped.

I am confused because my cylinders have different count sensors and valves. Also different count addresses

I suspect there was a bit of miscommunication between you and NI support.

There is a method on an Actor called "Pre-Launch Init.vi". This is generally the right place to initialize your channel. Then in Handle Stop Msg.vi, that's the right place to stop your channel.

But how are you supposed to have the address of the channel? That should be placed inside your actor before it launches. So your code looks something like this:

Untitled.png

My guess is that NI support as talking about "Pre-Launch Init.vi" and about setting values into the actor before calling launch, and that sounded to you like you were actually doing the channel init before launch.

0 Kudos
Message 25 of 25
(1,292 Views)