Quantcast
Channel: LabVIEW topics
Viewing all 66802 articles
Browse latest View live

VI Scripting - Nested Case Structure

$
0
0

I want to create and analyze a complex nested case structure programmatically via LabVIEW scripting.

The challenge I am facing is to retrieve/ parse the hierarchy of a previously created nested case

structure.

CaseStructure.jpg

Based on the example above, is there a possibility to retrieve the information that Case L3 is included in Case L2 and Case L2 is a included in Case L1? The scripting VI "Travese for GObjects.vi" only returns the references of all cases included in the VI but no hierarchy information.

 


Copy Excel Chart to Labview front Pannel

$
0
0

It is easy to copy and paste chart from and to excel,just as shown below:

1.png

 

But, how can I do this to labview front pannel? without typing elements one by one.just as below:

2.png

but ,in fact ,I have not found such input box than can accomplish this ,CAN NI offer some advice?

 

Generic event handler for latched buttons

$
0
0

Hi all,

 

In my LV8.5 application I have 15 latched buttons. By clicking a button i want to load a profile, so except the profile to load, the action for each button is the same. I made one event handler to load the profile, the value change events from all 15 buttons point to this event handler. Looking at the name suffix of each button, I select the correct profile and load it.

 

At first I didn't notice any difference between the Switch and Latch mechanical actions: when a button was clicked it held its 'clicked' visual status. I came across this post, explaining that the button returns to its initial state by reading the button's terminal. So I added all the button terminals to the event handler and make a dummy read. This resulted in resetting the buttons when clicked.

 

In my opinion this isn't a nice solution since when I want to add more buttons, I have to add them to the event handler and add the button terminals to the dummy read.

 

I tried to dummy read the 'NewVal' terminal of the event handler, but this doesn't reset the operated button.

 

I tried to read the value of the button via the 'CtlRef' terminal of the event handler. This approach resulted in an error message: Error 1193 LABVIEW: When a Boolean control has a latch mechanical action, you cannot use the Value property to read or write its value.

 

Is there a generic way to reset a latch button from the event handler?

Is there a nicer approach to implement this functionality?

 

Thanks in advance,

Stef

Disable keyboard search in Multicolumn Listbox

$
0
0

Hi everyone,

 

I have a multicolumn listbox that looks like this:

grafik.png

 

Also I have an event structure that is supposed to handle CTRL+C.

Unfortunately everytime i press C or CTRL+C the active line in the listbox jumps to the next item starting with "c".

How can I disable this "search" feature inside the listbox?

 

Thx in advance

Tektronix AFG3022B resets when parameter changes

$
0
0

Hi all.

 

I have a very annoying problem. I use a Tektronix AFG3022B (Arbitrary Function Generator), via USB, with Labview 2013 and the IVI driver (tkafg3k, ver. 3.7). Instrument is set up correctly, as far as I can tell, and I can communicate with the device and all. My issue is this:

I want to be able to change a parameter of the output (say, the signal DC offset) dynamically, inside a while loop. The simplest approach doesn't work at all:

Doesn't work > clicking sound > nothing changesDoesn't work > clicking sound > nothing changes

When the "dc offset" is changed in the front end, a clicking sound is continuously produced by the instrument (as if it is constantly resetting), but nothing else happens.

[Note: Outside the loop this works, i.e. by using a constant instead of a knob for the dc offset. Also, the clicking stops when I return the dc offset to 0].

 

So, I used an event structure:

This works, but resets the device every time!This works, but resets the device every time!

Now, this works, but whenever I change the value of the dc offset, the instrument momentarily resets (with the characteristic clicking sound), before applying the changes. This, apart from being annoying and potentially harmful for the device, is not tolerable in my experiment for a variety of reasons: I can't have voltages resetting all the time, as this screws up the measurements, and the time it takes (~1s) is just too long.

 

Dwelling just one level deeper, I see that the VI I'm using inside the event structure, the "tkafg3k Configure Standard Waveform.vi" is just a function call to the driver DLL:

tkafg3k Configure Standard Waveform.vitkafg3k Configure Standard Waveform.vi

So, there doesn't seem there's much I can do! Can this really be the case? Could there be any possible workaround?

[Note: the physical knobs and buttons on the instrument are still operational when the vi is running. Does this mean that the DLL constantly opens and drops communications?]

 

Thank you for your time.

Help/advice needed? Labview write data/display measured datausing arduino

$
0
0

I have obtained measured data using labview and now I want to write this data to an external small display(coupled to an Arduino Mega 2560 board via USB). How should I start.

1. Should I configure the arduino first using the aruino IDE program itself then start to VISA write in labview

2. Or can I directly start with Labview Visa write

 

In case you guys have any examples for me, please share with me. I am attaching an oicture of the end display with arduino

Is it possible to have a graph change aspect ratio for printing?

$
0
0

I'm running into an issue where the aspect ratio of a graph is different between when it is on the screen and when it is printed. Is there a way to change to aspect ratio right before printing, so that it will look right on the print, and then change it back to what it was so it looks correct on the screen as well?

 

 

WTF: Constant has properties?

$
0
0

 

 

1149.jpg

No need more words,just look at the picture and try the code.

Why there is no prompt for the difference?


[Vision] Color Pattern Matching and Pattern Matching

$
0
0

Hello again guys, this question is more theoretical than practical: I want to know what's the difference between "Color Pattern Matching" and "Pattern Matching", I've tried to find something online, but I can't see any difference between the two options of vision recognition.

 

I'd appreciate a lot if someone could send me a link or an explanation of this.

Thanks in advance!

[LabVIEW] how to force graph control size to increase in upward direction.

$
0
0

Hello All,

 

I am trying to create a concept where Graph Height increase for particular situation is TRUE.

When I use Property Node, it increase size in downward direction. Is there any possibility to increase height of Graph in upward direction?

PS: I am not allow to change position of Graph.

 

Example SS.PNG

Writing data of HEX into EEPROM adresses with particular storage format

$
0
0

Hello All,

 

Can anyone help me how to write floating point number with specific storage format and output as HEX i need, i will be writing the data 16 bit data

 

For example, I have a floating point number -177.609375 and storage format is s8.7 then i suppose to get HEX  A732 .

 

I have done code like

EX:1

i took the HEX A732 and storage format s8.7( in the main VI Enter 7 in the f control and in the signed unsigned control write s, in HEX write A732 ) i got the Value as -177.609375 this is valid.

Ex:2

i took the HEX A732 and storage format s15.0 i got the Value as -22734 this is valid as per our requirement.

(I have attached the Code for above examples)

 

Now by taking DBL value -177.609375 and storage format s8.7 as inputs i the output should be HEX A732

 

Regards,

Nafees

 

 

Is this style of coding appropriate?

$
0
0

Hello all, I have a question about the "style" of programming I am using in LabVIEW. Often I want to pass data and trigger event structures in sub-VIs and then pass data around from sub-Vi to sub-VI via the top level VI. The only way I have been able to achieve this so far is via reference controls and server references. Reading on the forums however, I often read that using controls as a data passing medium is a big no-no. However I have used this style in much larger applications to great effect. I essentially want to know what are the shortcomings of using this style, and is there a better way to achieve the same thing. Please see the attached VIs

Updating values from spreadsheet inside timed loop

$
0
0

Hello all,

 

I am trying to read values from a spreadsheet and feed those values to my controllers. I have attached the VI where every task is being carried out. Each VI has specific function written in it like reading data, writing data and evaluating/manipulating data. All these are timed loop. Inside the EVAL VI I am trying to read data from spreadsheet after each second and feed that data to my controllers. I have attached the  block diagram of how it is being done. 

 

The problem is when I run the EVAL VI block diagram it doesn't read the data after first row from spreadsheet, also it seems like my other data also get static as in they do not change frequently as they should. I am new to LabVIEW, so i do not understand what i should do? 

 

I tried putting a while loop inside timed loop with wait function at 1 second but that didn't work and I also think while loop is wrong as i am already using a timed loop.

 

Is there some synchronisation issue between different timed loop VIs? Please suggest what to doMain VIsMain VIsInside EVAL VIInside EVAL VI

Automatic changing conditional case structure for switching nodes

$
0
0

I'm working on ground drone development project with NI MyRios and XBee communication protocol through antennas. The goal is to have one central command computer that can communicate with the drones, and change certain settings on the robot.

 

I would like to have the computer send a serial message to one of the robots, allow the robot to change any of the current settings (if needed to), and respond with a status update for the robot. The computer would then communicate with the next robot, and cycle through all of the robots in continuously. Each robot has a different identifying number (1,2,3,...) in the serial message. I would like to use for loop to change the robot number automatically and have a certain condition met before changing the robots.

 

I'm not quite sure how to set this up in LabVIEW. Any suggestions on how to do this?

myRIO-1900 Error code: -63044. The RIO server could not be found on the specified remote device

$
0
0

I am trying to run a simple FPGA.vi on my myRIO-1900 device to confirm successful communication. I have been able to deploy multiple vi's to the RT on the myRIO, but any attempt in trying to compile and run FPGA code results in Error code: -63044: "The RIO server could not be found on the specified remote device."

 

We've tried updating the firmware on the myRIO based on the "Upgrading Firmware on my NI Linux Real-Time Device" article on the National Instruments website, which says we just need to go to the correct folder (for myRIO-1900 that would be the 762F folder). When I look in that folder through windows file explorer I see two .cfg files which looks similar to how it should be in the article. However, when I go through the Update Firmware button in NI MAX, the folders appear empty. Instead of looking for .cfg files, the explorer only allows searching for .lvbitx files. Is there some sort of software update I need to fix this? And would updating the firmware actually fix the error code -63044.

 

I have attached screenshots of both the error message and the firmware search from NI MAX. I also have a screenshot of the extremely simple code to test if the FPGA was working correctly.

 

I am running LabView 2017 on Windows 7 and the device is a NI myRIO-1900.

 

Any help would be greatly appreciated!


Updating values from a spreadsheet using timed loop

$
0
0

Hello all,

 

I am trying to read values from a spreadsheet and feed those values to my controllers. I have attached the VI where every task is being carried out. Each VI has specific function written in it like reading data, writing data and evaluating/manipulating data. All these are timed loop. Inside the EVAL VI I am trying to read data from spreadsheet after each second and feed that data to my controllers. I have attached the  block diagram of how it is being done. 

 

The problem is when I run the EVAL VI block diagram it doesn't read the data after first row from spreadsheet, also it seems like my other data also get static as in they do not change frequently as they should. I am new to LabVIEW, so i do not understand what i should do? 

 

I tried putting a while loop inside timed loop with wait function at 1 second but that didn't work and I also think while loop is wrong as i am already using a timed loop.

 

Is there some synchronisation issue between different timed loop VIs? Please suggest what to do

 Timed Loop VIsTimed Loop VIs

Code Inside EVAL VICode Inside EVAL VI

Is it possible to create a class or something combining 3 controls together?

$
0
0

Hi,

 

I need to gather data from  7 or 8 groups of sensors. Each group contains 4 to 9 sensors to display. When I gather data, sometimes I want to view the data changes vs time. Sometimes I want to switch to bar graph views with the mean values per 1 second.

 

For one group of data, I can just hide/show a waveform graph and an XY graph (see the attached test vi). However, I don't really want to repeat this procedure 7 or 8 times for all groups. Plus, if I do it this way, and if there is anything I want to modify, I have to do the modification 7 or 8 times. Therefore, I need a method to encapsulate the code, just what those text-based languages (like C++, ...) do.

 

Is it possible in labview?

 

Thanks!

Daqmx External clock for PXIe-4357 RTD module

$
0
0

Hi,

I am using PXIe-6358 & PXIe-4303 Analog input cards and PXIe 4357 RTD card on PXIe1082 chassis. 

My goal is to synchronise all 3 cards and acquire data at rising edge of an external clock.

I managed to synchronise them by having a common reference clock (PXI_CLK10) and common start trigger. Then I fed a sine wave to a channel on each card and managed to acquire that sine waves and verified that they are in sync. However, sample clocks are still taken from on-board clocks (i.e. source terminal of Sample Clock VI left default). 

 

I am generating a 1kHz continuous pulse train at PXIe-6358 counter 0 and I need to use this as sample clock for above 3 cards. From my understanding, I can route this to PXI_Trig0 and use that to source terminal of sample clock vi of each task. However, I have following issues.

 

1. PXIe-4303 complaints that it is not supported. According to the manual, it only accepts reference clock and start trigger as sources!

 

2. PXIe4357 RTD module can only acquire data at 100Hz. It throws an error when i try to oversample. Therefore, my end goal of having a 2D array of 1000x3 elements (1 sample at 1KHz from a channel from each card) is not possible.

 

Really appreciate of someone can give some tips if there is a way I can achieve my task.

GPIB driver for Ando AQ-6315A optical spectrum analyzer

$
0
0

Hello all experts,

 

I am looking for a driver software for Ando AQ-6315A optical spectrum analyzer which can define the connection between the machine and determine the address. During the searching, I found several LLB files but could not a driver. Is there anyone who can send or let me know where I find it?

 

Have a nice day and I am looking for some nice solutionSmiley Happy

 

Kind wishes,

Jung-Hwan

increasing LabVIEW cursor size.

$
0
0

Does anyone know how to increase the LabVIEW cursor size non programatically? My mouse cursor is extremely small and I cannot find it in the settings.

Viewing all 66802 articles
Browse latest View live


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