LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Integrated IO

Solved!
Go to solution

...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 13
(3,563 Views)

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 LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(3,531 Views)

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, 2021
Message 3 of 13
(3,528 Views)

@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, 2021
0 Kudos
Message 4 of 13
(3,525 Views)

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 🙂

Message 5 of 13
(3,518 Views)

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, 2021
0 Kudos
Message 6 of 13
(3,512 Views)

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 13
(3,507 Views)
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 🙂

 

Message 8 of 13
(3,464 Views)

Hello geeponline,

I'm also trying to read the IO port on a Cincoze P1001 module by using an old Visual Basic 6 application.

Could you let me know what is the DLL that you find out for that pourpose and also could you get me the code sample?

Thank you 😉

0 Kudos
Message 9 of 13
(1,994 Views)

I solevd all in labview.
You can find the DLL and some example (not labview example) in the attachment.

Message 10 of 13
(1,987 Views)