LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing digital values to simulated SCXI-1160?

Hello,

 

I'm having a hard time with my code snippet that I've used to write digital values to a port.  Essentially my program has three error conditions that are supposed to trip a relay in an SXCI-1160.  I've written to port on newer items like cDaq and I have a working example of using it on an SCXI-1160 but for some reason I can't get it to respond here.  I can put a probe on the line going into the code, but it doesn't appear that any combination of numbers causes anything to happen on the hardware.  Am I missing something?

 

The RB 16ch simple drive.vi is what I'm trying to use as a subvi since it's an 1160.

 

I pulled some parts out and made an independent sample code in write to 1160 task.vi, which uses the config.vi as a subvi.

 

Thanks in advance.  I've gotten arond it by using some case structures and Switch VI's, but it's much less efficient than Write To Port.

___________________________________________________________________
Still confused after 8 years.
Download All
0 Kudos
Message 1 of 12
(3,583 Views)

Hi Ralph@NES,

 

A port write configures the entire SCXI-1160 module. Is that what you are intending to do? Also, just to be clear, you are using the Traditional NI-DAQ driver, right (not DAQmx)? If so, which version are you using? There was a related bug that was identified and fixed with a patch years ago. If, on the other hand, you're updating from T-DAQ to DAQmx, you might need to invert the channels.

0 Kudos
Message 2 of 12
(3,563 Views)

I was trying to go for switch - type operation in reaction to start/stop buttons.  The driver on the 8.5 system it's running is whatever came with 8.5...  NI-DAQmx I believe.  I know a similar code structure works in 13 with a new cDAQ module in NI-MAX.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 3 of 12
(3,556 Views)

HI Ralph@NES,

 

When you say, "I have a working example of using it on an SCXI-1160", what exactly do you mean?  In what way is it working? Also, what exact physical behavior are you seeing when you say it's not responding?

0 Kudos
Message 4 of 12
(3,513 Views)

Jeff,

 

Thanks for your time.

 

The example is attached as a .jpg.  That's an older setup we had built for us using SCXI-1001 chassis with 1160 cards (2) in the last two slots.  We paid for the program ( and source code ) and I've been learning from it ever since.

 

Essentially it closes or opens switches on the 1160 to enable a piece of equipment to run, or prevent it from running if there's a stop button or error condition.  All the boolean variables are triggered by these conditions and, as you can see, the numerical value of the array sets the 1160 via the daq assistants.

 

What isn't working is the actual output to the 1160.  The 1160 doesn't seem to change or set state in my newer examples posted above, and I'm at a loss as to why.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 5 of 12
(3,490 Views)

I guess maybe I might be confused as to what I should be seeing.  I am assuming that by toggling the last three switchable conditions on and seeing "21504" that I'd be turning on channels 13, 14, 15 on the 1160.  Perhaps my expectation is not in line with reality.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 6 of 12
(3,486 Views)

Hi Ralph@NES,

 

It was difficult to diagnose the jpg, but I looked at your VIs, specifically the RB 16ch simple drive.vi, and I have several questions:

Since the True Case always executes. why so you need a case structure?

"Boolean OUT" will always read True, so why is it there?

Why do you have a False constant going to an inverter, instead of just using a True constant?

Why do you AND two True values?

0 Kudos
Message 7 of 12
(3,459 Views)

I pulled working code out of a different example and hard wired some things to bypass conditions in order to just verify the operation of the assembly.  The inverter would be coming back in from a shift register, and most of the other constants would be selectable conditions.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 8 of 12
(3,451 Views)

I think this is the most simplified version of everything I have.  Took all the conditions out except for 'on' and 'off'.  I'm trying to figure out what the bit count means in relation to open/closed relays and verify operation.  I only have a simulated NI-MAX setup to work with now, and the switches don't change state in the test panel.  When transferred to my remote stand, the behavior is either not correct or the switch channel/bit count alignment isn't what I think it is.

 

Right now, I'd assume that if I took the bottom three boolean switches and enabled them, my SCXI-1160 would connect the relays on 13,14,15.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 9 of 12
(3,441 Views)

I looked at your code and played around with it a bit. The data you are passing into the DAQ Assistant is just an integer between 0 and 21,845. What exactly are you expecting the DAQ Assistant to do with that number?  Also, what version of LabVIEW are you using?

0 Kudos
Message 10 of 12
(3,419 Views)