Quantcast
Channel: All LabVIEW posts
Viewing all 202893 articles
Browse latest View live

LabVIEW "VI cannot be referenced"

$
0
0

Hello,

 

I currently have a BK Precision DC Power Supply. On downloading the instrument driver, I went into the Private Folder where I saw the 'Special Write' vi, however this particular vi does not appear on my functions palette. When I try copy pasting this into one of my codes, I get an error message saying this vi cannot be referenced. On the other hand, all the other instrument driver VI's (appearing on the functions palette) work without any issues as expected.

I understand this is because the 'Special Write' VI is in the Private Folder and therefore can be accessed only within the folder. Can someone tell me how I go about changing the access to this, so that I can use the 'special write' normally like the other VI's the driver comes with? For example, ideally I would want to open up a blank VI, go to the functions palette and be able to access the Special Write VI. I also read somewhere I would need to add this to a .mnu file, however I'm unsure on how to do this.

I have attached an image of the folder for further reference. Any help would be appreciated

 


Re: LabVIEW "VI cannot be referenced"

$
0
0

Your understanding is incomplete.  It's not inaccessible because it's in the private folder; it's inaccessible because it is either marked as private in a library or is part of a class.  It's marked as "private" for a reason.  Your safest bet is to make a copy and place it in your own project, preferably in its own library to make sure it has its own namespace and doesn't get mixed up with the other VI of the same name.

 

Why do you feel that you need access to what is probably a low level function?

Re: Having issue VISA Read reading entire serial response

$
0
0

 wrote:

 wrote:

I can almost guarantee the problem is in your device.  I don't know if you'll  have any better luck sending all the commands at once.

 

Look at the problem from a high level.

 

1.  You open a configure the port.

2.  You write a command.

3.  You read the response.

 

There is no way you can be losing the beginning of the response since your port is already open with the buffer ready to receive it.  If you are missing part of the response, it is because the device didn't send that part.

 

Does it only happen on the first command you write?  Ever on the later commands?

Could you try to resend the first command in the event the first response fails?


I believe my device may clear what is readable from the command line. It outputs the message but then clears it to display the next message. This happens sporadically therefore sometimes it happens on the first command and sometimes on the later commands. There has not been a noticeable trend. It is clear that the responses never "fail" it's more like they are displayed too quickly perhaps and VISA read only captures the tail end.

 

Hardware wise I am communicating to other usb serial devices through a multiport USB Hub, so I am guessing there is bottleneck occurring while I send commands to other devices and this device just so happens to be on the latter end of the ports therefore gets clipped.


There's no such thing as "too quickly" for VISA.  If data is sent before the VISA read is executed, it goes into a buffer until it's read.  You get a buffer overrun error if you fill the buffer before reading.  That's what RavensFan was trying to say.

Re: Random Sample not updated

$
0
0

 wrote:

I am working on a project has a VI similar to the attached one.


  • Next time attach the actual VI, not something "similar". If they are not the same, you need to spell out all the differences. (Some differences I can see (1) No mention of the "Numeric 3" control, (2) 300ms instead of 500ms, (3) k is invariant during each iteration, (4), etc.)
  • There is probably no need to fire up Mathscript to add a few numbers, right?

 


 wrote:

However, Function B does not use the updated value of k -it uses the same one A uses.


You are branching the k wire, so each branch gets the same value. If this surprises you, start with a few LabVIEW tutorials and learn about the magic of dataflow. Smiley Very Happy

 

 

Is there a better way to code this?

$
0
0

I am almost positive this is Rube Goldberg code, but can't be sure.

Can someone help me figure this out? ...asking for a friend...IsRubeGoldberg.PNG

Re: Is there a better way to code this?

$
0
0

What is "this" that the code needs to perform? A better way would be not needing all these local variables (where are the terminal? What's in the other event cases? etc.). Even better would be to connect all the inputs of the select functions (the four on the right have no selector wired).

 

Please attach the entire VI. Does it work correctly?

 

Why can't you give your terminals intuitive names linked to their functionality?

Stumped on Array/List of Controls

$
0
0

Hi, all,

I'm an experienced software engineer but 6-months new to LabVIEW, and I'm stumped on how to set up an array or list of controls.

 

The individual control looks like this:

Screen Shot 2019-04-30 at 9.00.43 AM.png

 

Each control has behavior associated with it -- the button may be disabled, for example, depending on its data store.  The data comes from a remote process.  The value of the button and the numeric control (the other is an indicator) will be relayed to the remote process if changed.  Thus, one could imagine this gizmo as an XControl.

 

But, I need to present a vertical array of ~15 of them, manage their contents, and communicate with the remote process in terms of the index into the array.  So, for example, if the user turns on on the button in the 6th control, I need to send a message to the remote process like "Enable the 6th alarm".  Similarly, if the remote process decides the 11th alarm has triggered, it will send a message that signifies "turn the 11th boolean indicator red".

 

LabVIEW (2014) appears to reject populating an array with XControls or VIs.  If I use a simple cluster, I don't get the events necessary to manage the individual alarm state, both on the UI and in the remote process.

 

I think I'm missing some basic "handle" on configuring this UI.  Assistance or pointers to examples would be most welcome.

 

--Mark

Re: Stumped on Array/List of Controls

$
0
0

So you have an array of clusters. All you need is a single event case for the value change of the array. In it you can figure from the new vs. old what changed and what needs to be done. Since it is operated, it needs to be a control overall, but you can only disable elements that are disabled in all array elements at the same time, so they act like an indicator. You don't necessarily need to disable anything else, but just reset it to the existing value if the user attempt to change or press it while it should not be operated.

 

Can you attach a small example and explain in more details how things should react to the user actions? (old example)


Controlling RT Process and Stage Timing

$
0
0

I have a cRIO 9023. I will need to control the timing of various processes and stages within each process. An example template is attached and uses a half second timer for each of three stages. Each process begins after the user chooses which process to start. I will need to control the length of each process independently of each other and the length of each stage independently (if required). For example:

 

1. Process 1 runs for 1 minute.

    a. Stage 1 runs for half a second

    b. Stage 2 runs for two seconds

    c. Stage 3 runs for three seconds

2. Process 2 runs for 2 minutes

    a. Stage 1 runs for two seconds

    b. Stage 2 runs for three seconds

    c. Stage 3 runs for half a second

3. Process 3 runs for 30 seconds

    a. Stage 1 runs for 10 seconds

    b. Stage 2 runs for two seconds

    c. Stage 3 runs for four seconds

 

Here is the attached example:

 

https://forums.ni.com/t5/Example-Programs/UI-Producer-Loop-with-State-Machine-Consumer-Loop-Using-LabVIEW/ta-p/3523019?profile.language=en

 

Any assistance greatly appreciated.

 

Re: PXIe-6674T sync to backplane

$
0
0

Hi,

 

To synchronize the backplane clock of chassis to the OCXO of PXI-6674T, all you need to do is route "Oscillator" to "PXI_Clk10_In" on the PXI-6674T. When a 10 MHz signal is connected to PXI_CLK10_IN, the PXI Express chassis is required to derive PXI_CLK10 and PXIe_CLK100 from this reference. The LED will remain off because the 10 MHz PLL on the PXIe-6674T is not in use. The active LED will only turn on if the that PLL is active. Also, the NI-Sync API supports multiple devices with different types of oscillators; some have an OCXO, a VCXO or a TCXO. The API uses oscillator because the underlining technology can vary from device to device.

 

I hope this helps,

-Tyler

 

Re: Is there a better way to code this?

$
0
0

If this event structure is handling your entire UI, I would suggest that 100ms on the timeout will be noticeable by a user, depending on the timing of the action in relation to the timeout clock.  If you are not using the timeout frame for any specific purpose (we wouldn't know since your code isn't posted), it's best to remove the timeout value and let the event structure run as fast as possible.  This will help keep your UI responsive to user actions.  You also want to keep actions performed within the event structure to a minimum....no long running code inside.

 

Edit:  Scratch all that.  It's been a long week already and it's only Tuesday. 

Re: Want to measure resistance by using DAQ-9184 with analog output and input modules

$
0
0

You asked a lot of good questions, some of them are very valuable for me to think about. My research is not focusing on this part, I am studying the frozen soil, and we use Vishay most of the time, so really have no idea at all with NI system. I will try to answer your questions. 

First, I did not put any design for this data acquisition system, I want it to be as simple as it can be. Because I have other data acquisition systems for other measurements, which needed to be sync with this one. 

Second, I really have no idea about this one, maybe you can give me some advice. My unfrozen wet soil sample in a miller box is about 2 k ohm, but once it got frozen, the resistance will increase more than 1000 times, approximately. So, maybe 1 ma is not good enough.

Third, yes, I have calculated the voltage drop which is within the voltage range of the 9201/9205 (-10 to10 V).

Forth, nope. I haven't done, and have never done before, I will google it.

Last, we have a tool called NILSSON soil resistance meter which is designed to measure soil resistance.  I have to fill the soil into a miller soil box (with box factor=1), then whatever this device read will be my reference value. But this NILSSON soil resistance looks like something from 1960, and you have to manually measure the soil resistance every time, that's why I want to have a system can measure the soil resistance and record automatical since my test lasts more than two weeks. We want to have fully saturated soil, use a water tank with a constant water level and connect to with the miller soil box, and saturate the soil until seeing free water on the top. If we want we can put a moisture content sensor to measure the water content. 

Re: Having issue VISA Read reading entire serial response

$
0
0

I understood what RavensFan was saying. Let me reword what I was saying so it is clearer. My device responds too quickly for the hardware in the system to send all the data to the read buffer to be read, therefore Visa Read consequently captures only the tail end of the message because only the tail end of the message reaches the buffer... In no way am I saying that Visa Read is failing to function properly. As I have already discussed with RavensFan above, I believe this is a limitation of my hardware bottlenecking therefore clipping a portion of the response.

I have adjusted my hardware setup so now there are only 2 devices connected to a usb hub which is then connected to the PC. When I run the parent vi, which sends the commands to each device, only the 2nd device seems to be failing now (meaning the 1st device passes and sends all the responses correctly while the 2nd one still sends only snippits of the response).
A consistent result is occurring where the 1st device will pass and send back everything correctly and the 2nd device fails because it only sends back the tail end of the messages. This appears to reaffirm that it is a hardware issue that is causing the 1st device to take priority and the 2nd device cannot send back all of its response due to limiting bandwidth.

Would a better approach to communicating with multiple devices across the USB Hub be to communicate with 1 device at a time instead of simultaneously writing/reading responses in order to allow each device to send back the entirety of the messages without being clipped? Or does labview have a method to successfully do this task?

Re: Is there a better way to code this?

$
0
0

Thank you both for replying!

 

I did not post full code because I am trying to update an older version of a keyboard that is used to enter a product code. I am thinking through how to change the old code to meet new demands placed on the program before I make the change 40+ times (40+ buttons on the keyboard), so I only changed the code for letter 'F' and felt like what I coded was a really round about way of doing it (thus rube goldberg).

 

The old code is kept in keypad.vi.

The slightly modified code (changes only made in the event for the letter 'F', and nowhere else yet) is kept in keypadv2.vi.

 

The end goal of this program is instead of only allowing a fixed # of characters for the 3rd and 4th displays and forcing the user to enter from left to right, the user can click on each individual box (with a touch screen, no mouse) and enter characters and backspace characters for each individual display in any order, with upto 3 characters allowed for the 3rd display and upto 4 characters allowed for the 4th display (1st and 2nd displays remain fixed).

 

I appreciate your feedback.

Re: Having issue VISA Read reading entire serial response

$
0
0

Are you saying there is more hardware involved in the device side of things?  If that is the case, then something needs to be fixed in the device if the device itself is causing data to be lost before it ever gets sent out on the serial wires to your PC.  There is nothing you'll be able to do with LabVIEW to solve that problem.  At best you can keep retrying the communication hoping you get lucky and a complete response comes through.

 

Is this device manufactured by a third party?  Or is it something your own company makes that you are testing?  You should talk to whoever designed this device about the problems you are having as it sounds like a design problem they need to fix.


Re: Stumped on Array/List of Controls

$
0
0

That was the "handle" I was looking for!   As a recovering Java programmer, I find it a little strange to iterate over an entire array to find the one value that changed, but the UI cpu has nothing better to do at the time :-).

 

Thanks for the help!

 

-- m

Re: Is there a better way to code this?

$
0
0

Any chance you could post an older version of the code? Using Save for Previous Version. I have 2017 but I'd guess the earlier you choose, the more people can see it.

Re: Having issue VISA Read reading entire serial response

$
0
0

As far as the hardware side of things go my setup & code expand from sending to just 1 device to multicasting the commands to multiple of the same device. Each usb device is identical. When testing the devices individually they perform normally and send back all the commands. It's solely when I attempt to multicast the commands in parallel.


My company makes these devices that I am testing, but as far as their functionality outside of testing, they are singular units (they never have to interact with other units). I am merely attempting to do a scaled up test rig to test their functionalities without having to test each unit one by one.

Re: Controlling RT Process and Stage Timing

$
0
0

If the duration is an input to your code, and you know it before you start any of your processes, then this should be easy - just include the durations in the message data that you send to the consumer (following the template you linked, although you don't have to do it that way) and then call each of your stages with the appropriate input.

 

If the different processes have different stages that they need to call (not just changed durations), then you might instead prefer to queue up the stages individually. Be aware that if you allow multiple locations in your code to place new items in your queue, then you can't guarantee the execution order is as you expect (so don't do this unless it doesn't matter - usually it matters!)

Re: Having issue VISA Read reading entire serial response

$
0
0

 wrote:

As far as the hardware side of things go my setup & code expand from sending to just 1 device to multicasting the commands to multiple of the same device. Each usb device is identical. When testing the devices individually they perform normally and send back all the commands. It's solely when I attempt to multicast the commands in parallel.

 


Except you are not multi-casting multiple commands in parallel.  You are sending the commands sequentially.  Maybe in very rapid succession between command-response, command-response, but it is not in parallel.  And you are doing that for one device at a time.  In fact your code doesn't reflect the handling of more than one device.

Viewing all 202893 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>