LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure a "dummy" or "virtual" port

Solved!
Go to solution

Hi, I am relatively new to Labview programming.  I am working with NI USB 6212.  I was wondering if it is possible to create a "dummy" or "virtual" port so I can ultimately create a port line output eg. port0/line16.  Basically I want certain bits to go to this line and "do nothing".

 

Any suggestions would be appreciated.

 

Thank you,

vk

0 Kudos
Message 1 of 8
(6,543 Views)

You can created a Simulated DAQ device in Measurement and Automation Explorer.

Message 2 of 8
(6,538 Views)

I'm not sure I totally understand.  But it sounds like you want to create a simulated DAQmx device through MAX.

 

Inside of MAX, right-click the "Devices and Interfaces" and select "Create New...".  From there you can create a simulated device of any type that DAQmx knows.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 8
(6,536 Views)
Solution
Accepted by topic author v-k

There are a few ways to approach this and how you will use this "virtual Port"  is one of the choices between methods.

 

The simplest is to create a simulated USB 6212:

From Max select devices and interfaces

Right click >> Create New>>Simulated DAQmx device or Modular instrument

Expand +M Series DAQ and select NI USB 6212.

 

You will be able to create tasks channels scales etc... that are appropriate for a NI USB 6212 the DAQmx assistant will treat it as if it were real and you can try out the task and, LabVIEW code calling a task on a simulated device will run just fine.

 

The Down side is when you actually get hardware its often difficult to retarget the Tasks to use the real device (No option to send task to.. no option to swap device with....) Feel free to Kudos the idea. so you need to edit the task or swap device names and that is not fool-proof.

 

Another option that I use for my development (And, I code by intention... very seldom having any hardware or simulated devices in my cube)

is to not care about the task configuration until I integrate with hardware.  Lets show an example I have in my current project:

1!.PNG

With the exception of the task name this exact code is in the project I have open today.  This AE completely encapsulates anything I want to do with this Task.  Now I have code to drop into my application and can create the task easilly on the target machine.  Notice Here.vi? I'll just go through the Project Hierarchy and find all instances. Create the task and TEST IT on the live system.  When all instances of here.vi are gone my code is running error free and integrated with the hardware.

 

[edit] that's what happens with a three hour interruption while replying.  Tim beats you to it


"Should be" isn't "Is" -Jay
Message 4 of 8
(6,525 Views)

Jeff·Þ·Bohrer wrote:[edit] that's what happens with a three hour interruption while replying.  Tim beats you to it

Yeah, and Mr. "I'm Going to the Super Bowl" beat me while I was looking for the exact wording for the instructions.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 8
(6,502 Views)

Thank you everyone for the suggestions.  This helps!

 

Out of curiosity, is it possible to simulate a virtual or dummy ports on a real device?

 

Thank you,

vk

0 Kudos
Message 6 of 8
(6,490 Views)

v-k wrote:Out of curiosity, is it possible to simulate a virtual or dummy ports on a real device?

No.  You need to create an entire simulated device.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(6,478 Views)

Ok thank you.

0 Kudos
Message 8 of 8
(6,476 Views)