Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ARCOM Relay8/IN8 Counter

Hi - New to LabVIEW.  I had an engineer round on Friday to demo LabVIEW, well impressed but now well confused!  I have a proof-of-concept system with an XP SP3 PC, LV and an ARCOM Relay8/IN8 Card.  TBH we thought is came with LV drivers but alas not.  I've read the article at http://forums.ni.com/ni/board/message?board.id=140&requireLogin=False&thread.id=12045 which was helpful. 

 

I need to count newspapers coming off a press at various parts of the track.  I have the functions listed in the DLL wizard, so have the CounterINIT followed by CounterRead and that's linked to a numeric display with the data type set to "Adapt to Source".  I want to also have an LED pulse as the counter triggers but it keeps telling me I have a boolean data type connecting to a U32.  OK - I understand that, no issue but where would I connect the LED to then?  Also - where would I set up the stop button to connect to?  

 

When I try to run the VI, it flickers and does nothing.  Got to be something really simple but I can't see it.  If I can get this working, it holds a huge number of possibilities!

0 Kudos
Message 1 of 9
(4,100 Views)

If you attach the vi, I can have a look at it.

A one shot led lighting maybe too fast too see, so you need something that keeps it burning for at least 10 or even better 20ms

so  a case statement that runs parallel to the main vi could be triggered and keep that LED burning for the correct time.

greetings from the Netherlands
0 Kudos
Message 2 of 9
(4,068 Views)

Thanks for the reply.  Acually now think the issue is to get the VI reading the card - might be a start!  Using the Call Library Function, I have an INIT to initialise the card, but then I need to read the opto-inputs into a counter.  I'm just getting confused now!  I just have the ReadOptoInput from the DLL wired to a Numeric display, but that's probably not how to set up a counter?  Then I get errors saying the Call Library has unwired connectors.  Do I need a seperate call library for each call to the library or one instance to handle it all? 

 

 

0 Kudos
Message 3 of 9
(4,064 Views)

Hi

 

I looked at the specs of the card and saw 8 relays for output and an 8bit input sectiuon that delivers that state of 8 inputs.

No counters so you have to poll the card fast to count papers that are transported.

At what speed do you seee the papers moving, more than 100 per second? or much less?

 

You have to call init first, then PciRELAY8_OptoInputGroupRead and youget the value.

From this value you can recognize which bits are active. and from a bit going high and then low again you can increment a counter.

after all IO you need to close the dll.

 

So it is a very cumbersome method to count !

 

Instead of a dll you also can use the portIO functions when you know the IOadresses of the card.

greetings from the Netherlands
0 Kudos
Message 4 of 9
(4,052 Views)

Morning Albert

 

I'm fairly new to the IO thing, and our tech manager who's good at that is at another site in Ireland this week (if he's actually got off the ground in the snow!).  I have the card address and offsets, how do I use the port functions - is that the one with the chip-icon - InPort and OutPort?  It's only my 3rd day of LabView so it's all new.  I've got a vi that someone did in an earlier version of labview but it complains about missing componeents if I try to run it.  We run at an absolute max of 70,000cph - about 16 copies a second.   Usually slower than that though.

 

I'll have a look / play.
0 Kudos
Message 5 of 9
(4,042 Views)

OK - I give up.  I've kind-of canibalised the Parallel Port one in the Help file and whilst the timer works and I get no errors - I don't know enough about LV to know where I'm going wrong.  What I want is for the 'Numeric' field to show that I'm reading the pulses from the card.  I can look at incrementing them later - I just want to see come action!

 

My first proper attempt attached - don't laugh too much!   I sort of understand most of it, just not sure if I have it in the right otder - or even if Im looking at the right approach!  

 

From our point of view eventualy I want an engineerng display that will show indicators for everything and a users display that will only show a few counters.

0 Kudos
Message 6 of 9
(4,026 Views)

Good work

only one error, and a lot of indicators to find the error I suppose.

The default value coming out of a case statement is the standard default value for that data type.

So in your case this is zero.

You only needed to connect the wire going in the case statement to the output (in the false case) and you would have seen the number  be updated.

If and only if the address is indeed the correct IO address.

 

 I modified the vi and attached it. I also added an extra wait until multiple ms because the first wait is undetermined.

And mad a bit nicer value to look at.

greetings from the Netherlands
0 Kudos
Message 7 of 9
(4,019 Views)

Thanks Albert! That's great.   Well - it's definately reading something... not sure what.  Am I right in thinking then, looking at the Relay8 manual, that....

 

Register Read = Bit Function - so the Opto Inputs are on bit 7 so I set the Register Read to 7

Register Write = Offset - Opto Read is 01 (I think I might be wrong on this one)

 

I saw on another forum that the Relay8 card used 180 as it's standard address - mine shows up as DF3C - DF3F (XP SP3)

 

I'm getting Numeric readings like -27, 60, 120, 49, -48, 0 - not sure what I'm actually looking at here.  When the press is running - they aren't at the moment - I'd like to see it on a graphdisplay as well for several reasons, but mostly because I want to understand how the graphs work.  Failed wherver I connected it so far.   I've added a meter at the point where the register read is connected and that's working, what I would like to do is use that to somehow indicate copies per second or per hour.

 

Also - stupid question - how do I add a title/label/logo to the VI front panel?  I can't see a simple text or label object anywhere.  

 

The plan is eventually to read 3 signals coming in - one for 'Good Copy' - if that switches then switch a relay on/off and a 'Dump' signal that also switches a relay and the 24v pulse that we are looking at here as a counter and write that to a database at the end of a job.  I think it'll be quite complex and need a lot of work but if I can make it work then it could open up lots more projects.

0 Kudos
Message 8 of 9
(4,009 Views)

Hi Matt

 

did you check my vi. I added a digital array display. That should display all bits so you could understand what you are reading.

But the numbers you wrote don't make sense to me either.

greetings from the Netherlands
0 Kudos
Message 9 of 9
(3,999 Views)