LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring Multiple Counter Input channels through SIT

Hi ,
  I have a Matlab Model which has 2 input ports and 2 output ports. I created a dll and i am traying to call that using SIT. My aim is i want to configure those 2 input ports one as "Counter Input - Read Frequency" and other as "Counter Input - Read Pulsewidth", So for this i need to modify the generated driver VI's(<ModelName>_Io Io Init.vi, <ModelName>_Io Ioread.vi).  I modified the Init and Read vi's after that i am able to read only frequency or pulse width based on the order i configured in the <ModelName>_Io Io Init.vi but i want to read both. I am not worrying about output ports.
 
I am sending the complete stack in the attachment.  Actually i am struggling with this from past couple of days. Could any one help on this.
 
Thanks
naveen
0 Kudos
Message 1 of 13
(4,567 Views)
Could any one tried this?
0 Kudos
Message 2 of 13
(4,540 Views)

Hello,

What version of SIT are you using?

0 Kudos
Message 3 of 13
(4,534 Views)
Naveen,
I think the problem is in case 1 of the case structure.  You do not have the task in input wired on DAQmx Create Channel.vi.   For the first iteration (iteration 0) you want to create a new task, however after that you want to add channels to the existing task.  However since the 'task in' is unwired in the case for iteration 1 it will create a new task.

This can be seen easier if you create some extra space rather than leaving the code compressed.  You can create more space by either pressing Ctrl and dragging a box on the block diagram.  Another method for creating space is to right click on the structure and turn on Auto Grow and then resize the structure.

Carl L
National Instruments
0 Kudos
Message 4 of 13
(4,524 Views)

Hi Carl,

I tried to connect the TaskIn ip terminal in Create Channel then i am getting Error.No: 200147 "There Can't be Multiple counters in the same task for input operations" . This logic is working for other Operations like Multiple Channel Digital Input configurations.. etc

We are using SIT 3.0.2 version.

Any idea on this,,,

0 Kudos
Message 5 of 13
(4,511 Views)

Hello Naveen,

I was able to return both references by wiring the Task In terminal in the "0" and "Default" cases. I left it unwired in the "1" case. I did not receive any error. I suggest you try this and see if it is what you were looking for.

Cheers,

Emilie

Applications Engineer

0 Kudos
Message 6 of 13
(4,486 Views)

Hello Emilie,

    In that case i am getting same values(i.e pulse width value only) in both indicators, but i should get Pulse width & Frequency.

   R u able to read  PulseWIdth & frequency ?

 

CHeers

naveen

0 Kudos
Message 7 of 13
(4,478 Views)

Hello Naveen,

Sorry for the belated response. I've been working on this issue since your last post.

The error message you were receiving (200147) actually gave a great clue as to how to configure your SIT vi's to determine both pulse width and frequency. It seems you must create a separate task for each counter feature. As such, you'll need to add an additional task to the typedef. In addition, you'll need to modify the Init.vi that will actually create this extra Counter task to the initialization code. You'll have one created for Frequency and the other for Pulse Width. Be sure to close the extra task in your Close.vi as well.

I've attached a simplified version of the Init.vi and Ref.ctl that might help better explain the changes that I've suggested.

 I imagine might be other subtle changes you'll need to make to the SIT vi's as well. For instance, you'll now need to DAQmx Read.vi's in your SIT IO Read.vi. Essentially, any instance where you were referring to the one Counter task, you will now need two of. Hope this helps.

Cheers,

Emilie | Applications Engineer

Download All
0 Kudos
Message 8 of 13
(4,425 Views)
I 'm trying to configure Muliple Digital Input channels through SIT ( Labview 8 ,SIT 3.0.1) , could you help me to do this ?
Also if possible could you let your files in Labview 8 ( That can help me ) . Thank you
0 Kudos
Message 9 of 13
(4,389 Views)

Hi,

Rather than look at these previous vi's, I think it would be best to use the SIT example vi's located in the multidaqexample_IO.llb (Program Files>>National Instruments>>LabVIEW 8.0>>examples>>Simulation Interface). The daqmx vi's are polymorphic, so in the Initialize vi, select the tasks to be digital.

You might also review the DevZone article that discusses Using DAQmx with the Simulation Interface Toolkit. You should be good to go from here.

Good luck!

Emilie Kopp | Applications Engineer | National Instruments

0 Kudos
Message 10 of 13
(4,371 Views)