LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Integrated IO

Solved!
Go to solution
Highlighted

...Hi!
I've just bought an Industrial PC with an integrated IO board I'd like to use.

In the Manual there is this example on hot to configure the ports but I can not figure out how to convert this in Labview

[code]#define AddrPort 0x4E
#define DataPort 0x4F
<Enter the Extended Function Mode>
WriteByte(AddrPort, 0x87)
WriteByte(AddrPort, 0x87) //Must write twice to entering Extended mode
<Select Logic Device>
WriteByte(AddrPort, 0x07)
WriteByte(dataPort, 0x06)
//Select logic device 06h
<Input Mode Selection> //Set GP70 to GP77 input Mode
WriteByte(AddrPort, 0x80) // Select configuration register 80h
WriteByte(DataPort, 0x0X) //Set (bit 0~7) = 0 to select GP 70~77 as Input mode.
<input Value>
WriteByte(AddrPort, 0x82) // Select configuration register 82h
ReadByte(DataPort, Value) // Read bit 0~7(0xFx)= GP70 ~77 as High.
<Leave the Extended Function Mode>
WriteByte(AddrPort, 0xAA)[/code]

 

Which VI family should I use?

0 Kudos
Message 1 of 8
(998 Views)
Highlighted

Hi gepponline,

 

install Win95 (yes, Windows95) on that computer.

Then install something like LV6.

Then use the InPort and OutPort functions to access your "AddrPort"!

 

On modern OS (like Win7 and newer) a user isn't allowed to directly access IO ports…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 8
(966 Views)
Highlighted

Ciao Geppo, you are not specifying your operating system, so I will assume it's Windows.

Since the advent of Windows XP, it is no more possible to read_from/write_to I/O ports directly from programs running at user mode, so a device driver running at kernel mode is required. LabVIEW 7 had a set of vi's for reading/writing values to I/O port, based on a multi-purpose driver installed along with LabVIEW itself. However, this functionality was dropped in later versions of LabVIEW.

Usually, to control such industrial I/O boards, the manufacturer provides a device driver for the various OSes and an interface dll or another component (ActiveX, .NET, ...). So the suggestion is to ask the manufacturer something like this.

If no driver is available, you would need to write one yourself, or, better, use commercially or freely available multi-purpose drivers. The functionality of reading/writing to ports is very basic, so probably a free / open source driver can be found (I'm not aware of anyone though). I used Jungo's WinDriver in a project a lot of years ago; with WinDriver, you were able to switch to kernel mode and run (at your own risk) a whole C function code. I was programming with MS Visual C++ and Visual Basic at that time; I don't know whether a direct integration into LabVIEW is possible.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
0 Kudos
Message 3 of 8
(963 Views)
Highlighted

@GerdW ha scritto:

Hi gepponline,

 

install Win95 (yes, Windows95) on that computer.

Then install something like LV6.

Then use the InPort and OutPort functions to access your "AddrPort"!

 

On modern OS (like Win7 and newer) a user isn't allowed to directly access IO ports…


Those functions were available with LV7.1 under XP. I believe the support was dropped since Vista.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
0 Kudos
Message 4 of 8
(960 Views)
Highlighted

ignoring GerdW's line... it seems there are OpenG  Port IO Vi's available.

And i Will use them with LabVIEW 2017 and win10 IoT pprt 🙂

0 Kudos
Message 5 of 8
(953 Views)
Highlighted

The driver used in OpenG PortIO functions is quite old. I believe it's not working any more under recent Windows versions.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
0 Kudos
Message 6 of 8
(947 Views)
Highlighted

I'll give it a chance and let you know 😉
However this PC is brand new and it's used by many people in industry and they can use the IO port so, it must be a way do it even in labview....

0 Kudos
Message 7 of 8
(942 Views)
Highlighted
Solution
Accepted by topic author gepponline

Solved!

I got a DLL to access the IO port.

Now all work correctly and I have an industrial PC with 16 integrated IO fully working on LabVIEW 🙂

 

0 Kudos
Message 8 of 8
(899 Views)