LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read more bits.

The image just shows a couple of terminal blocks. Trace the cable(s) to see what sort of actual device is connected and doing the acquisition.
0 Kudos
Message 11 of 18
(1,396 Views)

Might be making some progress here... when I try to open the VIs from that LLB, I get an error that ADSAPI32.dll is missing. An Internet search says that DLL is from Advantech. A bit more searching on Advantech's site for "PC-LAB" pops up a connector block that looks a lot like the one in your image: http://www2.advantech.com/products/GF-5AIQ/PCLD-780/mod_C59E881B-5647-472B-8589-C0A89853AC65.aspx. Those VIs though are really old (saved in LabVIEW 6.0, and use CINs rather than direct calls to a DLL).

 

Looking at the VI properties under Documentation, it says there is a help file under <helpdir>:\Advantech\LabVIEW.chm. I'm not sure where "<helpdir>" is on your computer (what operating system is this running?) but you might search your computer for "LabVIEW.chm" and see if you can find that help file.

 

Based on your comment about a pop-up for PCL-812PG, it appears that you have this device: http://www2.advantech.com/products/1-2MLJW2/PCL-812PG/mod_3ef33953-ade1-4801-aaa1-ad0a6d377e2c.aspx (couldn't you have done this internet search yourself, and saved the rest of us some time?) It's an ISA card, which, like the drivers you posted, is old. There is LabVIEW driver (perhaps newer than the one you're using) available for it from a link on that site.

 

That board supports 16 digital inputs. You wrote that you can read a byte from either Port 0 or Port 1. Each byte is 8 bits, so that's 16 total channels. What's the problem? It sounds like you can read all the digital inputs on the board. Perhaps you're connected to a channel on the terminal block that isn't actually connected to a digital input?

0 Kudos
Message 12 of 18
(1,378 Views)

 

That board supports 16 digital inputs. You wrote that you can read a byte from either Port 0 or Port 1. Each byte is 8 bits, so that's 16 total channels. What's the problem? It sounds like you can read all the digital inputs on the board. Perhaps you're connected to a channel on the terminal block that isn't actually connected to a digital input?

 

When I select port 0, bit 0 to bit 7 signals will be seen.Some LEDs go red and some other go green as per the input given by instrument. But the LEDs 8-16 goes green. when I select port 1, 0 to 7 goes red and 8-16 all goes green, where as there is no signal given to bit 8, so I am supposed to see 8 going red!!! But this is not at all happening.This is my problem.and one more thing..How do I get both port 0 and port 1 values in a single vi?

 

0 Kudos
Message 13 of 18
(1,350 Views)

ashnu wrote:

When I select port 0, bit 0 to bit 7 signals will be seen.Some LEDs go red and some other go green as per the input given by instrument. But the LEDs 8-16 goes green. when I select port 1, 0 to 7 goes red and 8-16 all goes green, where as there is no signal given to bit 8, so I am supposed to see 8 going red!!! But this is not at all happening.This is my problem.and one more thing..How do I get both port 0 and port 1 values in a single vi?


Place two instances of the ReadPortByte function on the block diagram. Wire 0 to the port input for one of them, and wire 1 as the port input for the other. Convert the resulting bytes to arrays of booleans (duplicate the existing code), then use build array to concatenate the array from Port 1 onto the array from Port 0. Now you have an array of 16 elements covering all the inputs.

0 Kudos
Message 14 of 18
(1,336 Views)

Hi, Thanks a ton!

I am now doing the analog part, that is I am just trying to read the raw signal, But since my instrument is  not being operated for various Hydrocarbon levels, I just thought of using a Voltage generator (Basetech BT-305). So I am just putting an indicator outside the PC-LAB (V-GET) subvi..But unfortunately it is not reading any signal. It is just showing 0.02V for channel and gain value equal to zero! Since the analog voltage range of the Instrument is 0-10V, the gain code must be 0. There are 15 available channels, if I choose channel other than 0, then the voltage keeps on fluctuating (-1 to -5V) in this range. So what may be wrong? 

0 Kudos
Message 15 of 18
(1,310 Views)

Does this mean the digital part is now working?

 

I only do help with digital signals, analog is someone else's problem 😉

 

Most likely the problem is grounding - at least, that seems to be the most common source of problems with analog readings. There's not enough information here to make any other guess. A fluctuating value is normal for a signal that isn't connected. How do you know what the gain value should be? Did you find documentation for the device? Are you sure you wired the voltage generator to the analog input correctly?

0 Kudos
Message 16 of 18
(1,295 Views)

On the help option of the Subvi, I saw the Gain code for PCL-812 for + or - 10 V, it was written zero.Yes I am sure that the ends of the analog output from the testa was connected to the BT-305 device. Only for channel 0 there is no fluctuation so I am expecting 4.5V that is showing by the devive on the vi!! But it just says 0.02 in both cases either it is connected or disconnected (because I even tried removing the connection and running the vi)

0 Kudos
Message 17 of 18
(1,281 Views)

I assume you've removed any other connections to the analog channel. Did you also connect ground on the voltage generator to the negative terminal for that channel (if there is one), or otherwise make sure that the ground reference for both the analog input and the voltage generator are the same? Do you have a multimeter to confirm that the voltage output is what you expect at the analog input terminal? Do you have a spare small battery lying around (a 9V battery is good, a 1.5V AA will work too) that you could use, since that will eliminate grounding issues (you can safely wire ground on the analog input to the negative terminal on the battery without any worry that you'll introduce a ground loop)? Have you tried other channels? Do you know that the analog channel is good (not broken)?

0 Kudos
Message 18 of 18
(1,276 Views)