LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I access Computer registers

Solved!
Go to solution

I am investigating using Labview Realtime on an embedded PC. 

The embedded PC has GPIO ports Mapped to a Register Address.

In this case 0x0284. First 4 Bits are Output, Second 4 are Input,

 

How do I read and write fron this fixed register.

 

If I was writing C-Code in MS-Dos it would be:

 

Outportb(0x0284,myOutputState_u8);

myInputs_u8 = InportB(0x0284);

 

[Apologies if my C may be a bit rusty]

 

 

Older forum posts suggest the use of "in port.vi" and "out port.vi" But I am not seing it or an equivalent in LV 2012.

 

There are Visa Peek and Poke Functions that appear to Be VXI or PXI resource specific.

 

Labview Help Links to:

 

Port I/O VIs

Owning Palette: Connectivity VIs and Functions

Requires: Base Package (Windows). This topic might not match its corresponding palette in LabVIEW depending on your operating system, licensed product(s), and target.

Use the Port I/O VIs to read from and write to a specific register address.

But isn't perticularly useful

 

Any suggestions?

 

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 1 of 9
(3,087 Views)

Hit 'search' on the palette and type 'port'. It's there.

0 Kudos
Message 2 of 9
(3,053 Views)

@Timmar wrote:
[...]

Older forum posts suggest the use of "in port.vi" and "out port.vi" But I am not seing it or an equivalent in LV 2012.

[..]

 


That is because they are obsolete. Due to user management and security constaints OS sided, they do not work on current OS versions, at least not on 64bit. On 32bit, it is highly discouraged to use them.

 

Using LV RealTime brings its own OS, i haven't seen that function on RT at all. From your description, it seems to me that you are not using LV RT, but another RT OS running some LV. Correct?

I am not sure if In Port and Out Port would even work on this type of OS, even if you manage to "use" it by copying from older LV VIs.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 9
(3,041 Views)

Toecutter

 

Not seeing it. Is there a special module I need to Install.

 

 

SearchPort.png

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 4 of 9
(2,999 Views)

Thanks Norbert, I suspected as much.

 

No, trying to get LV RT (Phar Lap I think) down onto an Atom based embedded PC.

 

I am a little confused, when I spoke to someone at NI about this he told me that you need to have a base RTOS to put LV RT on top of, but this seems a little strange, I was expecting to get full OS for my AU$700.

 

Looks like a promising, cost effective replacement for the cFP.

Would be icing on the cake if I could get the GP-I/O working on it.

 

Plan B is to load a .DLL on startup.

This is new territory for me and would like to avoid it if i can.

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 5 of 9
(2,995 Views)

Weird- I don't understand why there's a difference between your VIs and mine. I'm using 2012 also.. no extra packages were required. I have the 'full development' version but AFAIK the port commands are not an extra with that.

 

 

0 Kudos
Message 6 of 9
(2,987 Views)
Solution
Accepted by topic author Timmar

Ok, first and most important:

Regarding your OS, the Port functions possibly are not included in any palette. So searching them there is not viable.

Refer to the Details in the "In Port" help for exact information:

As of Windows Vista (hence 7, 8 and future), the function is not in the palette anymore. Using existing LV code with those functions works on 32bit Vista/7 but will fail on 64bits (due to security features in the OS).

 

Searching the vi.lib for these functions in LV 2013, i haven't found it and it seems that there isn't even any documentation. So i assume that "In Port" and "Out Port" are now completly removed from LV (as of 2013).

 

Due to this KB, using these functions should be possible to run on LV RT (ETS based at least). But as this KB is very old, i wouldn't rely on it.

 

Regarding LV RT and a RTOS: LV RT supplies you with an RT OS license (and installation components) based on either ETS, VxWorks or nowadays even a RT Linux depending on the target. The core is selected by the target for the installation.

I am not sure if LV RT (OS) supports Atom based desktop computers, so you have to check out if you can select and install this system as RT target using MAX. If the target does not show up in MAX, you can create a bootable USB drive to install RT on the desktop target (Tools >> Create Desktop PC Utility USB Drive).

 

hope this helps,

Norbert

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 9
(2,964 Views)

Thanks for the Link, 

 

I am using windows 64 bit, so it is almost certainly hiding it from the palette.

 

I will dig further to try to find it.

 

Thanks,

 

Tim L.

 

 

--------------------

 

 

I have setup a Atom based Embedded PC with LV R/T ETS and deployed our primary application.

 

It is 8 times faster, has twice the comms ports and is roughly half the price of a cFP2220.

 

Development deployment is super fast as well.

 

I am doing a happy dance at the moment. My 9 minute boot time has reduced to 1:45, working around another problem (LV Characteristic) that I have been suffering without solution.

 

 

The GPI/Os are for our advanced PXI based system. The embedded solution is 1/10th of the price,

Using the Embedded GPI/O port would be icing on the cake, saves purchasing a PCI Digital I/O Card to Plug into the expansion slot.

 

I can save $1,000 per system if I can resolve this.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 8 of 9
(2,927 Views)

We support our legacy software and as such we have LV 8.6 Running on an XP VM.

 

I crated the VI there and then opened it in 2012, Hey Presto, there it is.

 

Still not on the Palette, but I have a workaround, Thanks!

 

I will see if it works in the Target when it arrives.

 

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 9 of 9
(2,925 Views)