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

Open LLB VI Server

$
0
0

Is there a way to programatically open an LLB, in the LLB manager, using VI Server?

 

Opening a VI, Library, Project, etc all can be done relatively easily using VI Server but I didn't see a method for opening an LLB.  Looking at the LLB Manager in the <LabVIEW>\project\llbedit.llb\LLBMgr User Interface.vi  I see that I can provide the path to an LLB in on the Path control (not on the connector pane) and run the VI and it will work, but using this method has a problem when you try to open a second LLB because this VI is non-reentrant, and it won't open a second window.

 

One method that does work is using the command line with the full path to the LabVIEW.exe and the LLB path being the first argument.  The problem with this method is it doesn't work consistently with multiple versions of LabVIEW open.  It will often open in the wrong version.  But using VI server I can specify the port to open an application instance on, and make sure that the version I want it opened in, is the version 


2015 Icon Editor Behavior

$
0
0

So I am seeing some strange behavior with the Icon Editor in 2015 32bit (have not tired 64) and wondering if others are.  I have seen it on two computers so its nothing local to a computer.  

 

When first opening the icon editor my normal work flow is to CTRL-A to select the entire area and hit Delete to clear it.  This gives me a clean slate to select one of my templates and make the icon I need.  In 2015 this does not seem to work.  CTRL-A seems to select everything but when I hit delete the dashed line used to select disapears but the existing icon remains.   If I take it a step further and use the Select tool to select the entire area I see the same behavior.  

2015-09-16 09_17_13-Clipboard.png

 

However if using the Select tool and I select some subset of the icon Delete works and the selected area is deleted.  By doing this several times I am able to clear the enitre icon.  So it apears the issue is only when the entire area of the icon is selected.   Anyone else see this behaivor?  Seems like a bug to me.

 

2015-09-16 09_19_05-Icon Editor (Untitled 2).png

Issue with VISA Wait on Event errors?

$
0
0

Hi folks,

 

Sorry in advance for the wall of text, I just want to give as much information as I think is warranted.

 

I've been struggling with a custom serial communication scheme for a while now, and I'm ready to ask for help and advice. I believe the client device is not responding to commands every now and then (which I believe I've satisfactorily proven using a polling of bytes at port), but the VISA Wait on Event vi is throwing errors that I cannot explain. I have it configured to wait for Serial Character events analogous to the "Detect Serial Break Event" example VI, with my event type enabled and flushed on startup, then VISA Wait on Event called with a 1000 ms timeout in a read loop until the program ends. 

 

The gist of the communication interface is to write a few bytes to the client device and wait for a response packet using VISA Wait on Event. As soon as the event is detected, a single byte is read which contains a payload byte count. That number of bytes is then read and passed out for processing through a user event queue. All seems to work pretty well most of the time, even with the device periodically forgetting to respond, but VISA Wait on Event is, according to NI I/O Trace, throwing timeout expired events much faster than once per second, but intermittently. Looking at the details of the calls in NI I/O Trace, it appears to sometimes be called with a 0 ms timeout, resulting in a flood of timeout errors (as one might expect). These error calls also show 2 additional input parameters: outEventType=NULL and outContext=NULL. I am only calling this VI in one place, and the timeout is wired with a 1000 ms constant. Is there some weird internal behavior in this VI? How can it ever be called with a 0 ms timeout if I don't code it that way? Is this somehow related to receiving multiple bytes between wait on event instances?

 

I've attached an nitrace log so you can see traffic and errors. Note that when I first start the trace, I can get up to a few hundred of these wait errors before it seems to "hook into" the traffic properly. Perhaps the errors are entirely fictitious? I noted that the 0 ms timeout errors don't show up in the Desktop Execution Trace Toolkit, while the 1000 ms timeouts do. Thank you in advance for your time.

tabs in exe subVI in LV2015

$
0
0

I have a VI that calls a subVI that has tabs.  I use 'SubVI Node Setup' to open the front panel when loaded.  

 

I use Application builder to create an .exe of my VI.  

 

When i open the exe on my target machine, the subVI opens but I cannot switch tabs.  With LV2014, I could switch tabs

 

Any one else seen this?

 

Grant

 

 

Exporting All Tree Control Item names to array

$
0
0

I want to export all my tree control's items to a 2D array of strings so I can use the data in another application.  How do I do this programmatically?  Do I have to iterate on items or is there some easy trick?

pid output zero problem

$
0
0

Hello everyone,

I am having problem with my FPGA PID control. When I want to control the speed of motor, the output of PID is always 0. Why is that, and hoce can I fix it. 

I would be grateful for any help.

visa timing swapping data Agilent Vacuum Controller XGS-600

$
0
0

Hello all,

 

I'm reading vacuum pressure off of an Agilent XGS-600. I'm connected through an USB-RS-232 converter. 

 

NI-VISA Interactive Control works. My VI for a single channel works. When I duplicate the write/read (ie the channel) and change the channel, making a request of each channel, one at a time, it works. Channel 1 reads and displays Channel 1 pressure. Channel 2 reads and displays Channel 2 pressure (NOCBL at this time which is perfect to not get values mixed up).

 

What I'm observing is that with both channels on at the same time, Channel 1 displays Channel 2 pressure and Channel 2 displays Channel 1 presure. They are both in Case Structures. If I set one channel to false and the other to true and manually toggle the boolean whilst the program is running, then I sample Channel 1 and it displays Channel 1, then Channel 2 and it displays Channel 2. When I then remove my boolean control and replace with a NOT and registers so it will toggle itself (add a clock for timing), it will fail to maintain and put 1 on 2 and 2 on 1, again.

 

I've tried several different layouts (ie all in one loop in a flat sequence, parallel while loops, etc etc) and messed with adding timing variables. Also tried different clear and othe VISA VIs. Nothing seems to be fixing this problem.

 

Not sure what to do next.

 

Ideas?

Adding Dynamic Measurements to .STL Model in Labview

$
0
0

Hello Everyone, 

Beforehand I appreciate taking the time to read this post, it is a problem I have been struggling around for a bit (some weeks).  In summary, what I'm trying to do is to import a STL (Solidworks, Inventor, etc.) model into labview, and with the 3D Picture Control Library add Text Labels to it.  The user may rotate the model, and the labels should display readings for each part of the model. 

The problem is, that the STL model is usually complex, and there are many labels to include. As the user rotates the object, the labels show themselves "mirrored", or get lost behind pieces of the STL model.  Is there any solution of this problem?

I have though of:

1. Maybe it isn't possible to relocate the text labels when the model rotates and covers them. But, could it be possible to fix the "mirrorizing" problem with 3D Picture Control?

2. Is there some other way to manipulate 3D Objects, that I'm not aware of?
3. Is there maybe a more adaptable conversion than STL to manage in Labview? (I design my objects in Solidworks, but there might be a conversion to another format somewhere).

4. It might be necessary to code my models into C, or another programming language and then add them to Labview. The question is, how?


I have included a test VI of a LEGO, you only have to change the path of the STL model. As it can be seen, the labels mirror themselves or are partially/fully covered by the STL object. 


Word Report Gen Toolkit - Find String Location

$
0
0

Hey guys,

 

Does anybody know how to search a Word document for a string and output the location at which the string was found?

The closest I can find is NI_Word.lvclass:Word Find & Replace (str).vi, which looks like this:

Word Find and Replace.png

But it does the replacement using the Find command and doesn't output any range for the find.

 

To elaborate on my end goal:

I'm trying to append an array of pages to my report. The pages are identical except for the specific values within the page, so I'm loading them as a second Word document template and inserting that doc in to the main template. There are two images on each page, but the only way to insert an image in to the Word report is using a Bookmark or a Range. Unfortunately, you can't have duplicate bookmarks, so only one of the generated pages has the bookmarks if I try to use them. This is where I run in to problems and am hoping to use a known string on each page (from the template) to locate the spot where I need to insert the images.

Using the Period (dt) right data node for Timed Loops

$
0
0

I'm struggling to understand how the Period right data node functions. The help indicates that it should set the period for the next iteration of the timed loop, but I'm finding that it seems to set the period for the current iteration of the timed loop. Perhaps I'm not timing things appropriately. Hopefully someone can set me straight here.

 

I've attached a .vi that should demonstrate the issue. TIA for education/assistance.

Reentrancy with a subVI inside itself

$
0
0

I'm trying to create a utility that will read any kind of variant, automatically unpack it and create some sort of string output. I am using some VIs from VariantType.lvlib to help with this.

 

It got confusing when I started trying to unpack clusters. GetClusterInfo.vi creates an array of variants which then need to be run back through the same vi that unpacked the cluster. I was hoping to be able to do this by making the vi reentrant but this is somehow causing the data inside the original variant to disappear.

 

I don't want them to run in parallel as much as I want them to run nested. Is this possible?

 

DebugWriteToFile.vi is the main vi. which calls DebugVarDecode.vi.

AKD Servo Drive tuning in LabVIEW

$
0
0

Hi All,

 

I am trying to use the interactive test panel to perform motion of my servo drive. I have followed through using this NI youtube video tutorial (https://www.youtube.com/watch?v=545p8e5HFOI), I am working in velocity mode using the AKD servo drive and a KBM 45 motor and an NI 9516 module. The motor and drive works well using the Kollmorgen AKD workbench software.

However, when I start a move using the labview interactive test panel, it moves to the required position, but then begins to oscillate from side to side and never comes to a stop, suggesting that it is not properly damped. Does anyone know how this can be resolved? I suppose it has to do with tuning, is there a way I can get the PID gains from the AKD drive and input them into the LabVIEW Softmotion gain tuning panel? Thanks in advance.

Using a project within another project

$
0
0

If I completed a project, and then wanted to use that project as a sub element within a new project, what is the best practise for doing this?

 

Also, what happens if I have 5 projects, and I called the main VI in each project "main"? If I then wanted to bring all of those projects together into one project with a menu function that calls up the project you wish to use, won't you effectively have multiple VIs all called main? 

 

I am working trhough the exercise sheet that I was given after core 1 and 2, and one of the challenges is to create a VI that calls up each of the previous VIs based on a menu.

 

I am concerned that working across projects might mean files get missed etc, so wanted to know the best practise for this.

cRIO build error

$
0
0

Hi,

 

I'm having some trouble, compiling a LabVIEW 2012 project for a cRIO 9074. I did some changes in an existing project which seemed rather minor to me, and since tuesday I only get a compiler error when I try to build it for the target. If I just open and run the VI, I get no error message and it runs without problems/warnings.

 

This is the message I get:

Cannot complete build because following VI loaded broken:

C:\NI\LV2012\PCB2\Code\Main.vi

Open the VI in LabVIEW and fix the listed errors. If the VI loads as expected but errors are still detected during the build, contact National Instruments technical support for assistance.

- Details Display Dialog.vi:
    Function not supported for current target
- Main.vi:
    LabVIEW needs more memory to compile VI.
- Not Found Dialog.vi:
    Function not supported for current target Sub VI not supported in current target

 

Details:

Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference:

Error 1003 occurred at AB_Get_Detailed_BrokenVI_Message.vi -> AB_Targetfile.lvclassSmiley Surprisedpen_Top_Level_VIs.vi -> AB_Build.lvclass:Build.vi -> AB_Application.lvclass:Build.vi -> AB_RTEXE.lvclass:Build.vi -> AB_Engine_Build.vi -> AB_Build_Invoke.vi -> AB_Build_Invoke.vi.ProxyCaller

Possible reason(s):

LabVIEW:  The VI is not executable. Most likely the VI is broken or one of its subVIs cannot be located. Select File>>Open to open the VI and then verify that you are able to run it.

 

Sometimes, the compile and deployment finished without errors, but if I tried to open the remote panel, It said, it was broken and could not be opened. Sometimes, LabView crashed during compile as well.

 

I tried:

- Disabling suspicious code like the new global variable I introduced

- Going back to a previous version of my project

- Changing compiler optimization so that no optimization will occur (set from 5 to 8)

- Reinstalling cRIO software ni-RIO 12.0

- Cleared compiled object cache

 

I'm afraid there's something wrong with the LabView installation. Or is it the OS itself? Or is there a reason to believe that more RAM will help (I currently have 4GB). This post makes me believe the opposite.

What can I do to check the installation? I don't want to reinstall unless it's sure it helps.

 

Best regards,

Simo

UTF-8 codes in the URL input of data socket

$
0
0

Hi All,

 

I am trying to download files from a server using the Data Socket functions. I tried using the URL

**http://stb.site90.com/Plugins/LV GUI (CE).zip*[text] on the Data socket input terminal and was able to download the corresponding file (Code Attached ). But on copying the URL to browser (Google Chrome) the address bar displayed it as

**http://stb.site90.com/Plugins/LV %20GUI%20(CE).zip*[text].

 

I discovered that the browser tends to replace certain special characters in the URL with their corresponding UTF-8 codes.

  1. Are there any such exceptions/ special characters (Like: !, #, &,^ etc) that Data Socket will not understand, which should be considered while providing input to Data Socket functions?
  2. Should the special characters always be replaced with their corresponding UTF-8 codes before using the URL as Data Socket input?

*[text] is appeneded to the URL so that Data Socket functions returns the output in unformatted text.

**Please use a public URL. The above URL is provided just for a reference.

 

Simple Downloader.png

 

 

Regards,

S.P.Prasaanth


VISA only reads parts of buffer from serial device

$
0
0

Hello, 

 

I am rather unexperienced with serial communication and have encountered a problem trying to communicate with my RS-232 serial device.

 

When sending a command the reply is split  and I have to run again to read all.

For example: I send C0001\n to start a measurement and receive: 1. time C0001 and 2.d time \s00000137\s00000150\s00000000\06C0001\06 and I'd like to have it all in one reading operatiuon.

 

Sends finish with a \n and replies with a \06 (positive) or \15(negative). Replies are in the format C0001\[\sDATA]\06.

 

Do I need to define different TermChars for reads and writes? 

 

I am using labview 2014

 

Thanks in advance,

Marvin

Dice Frequency

$
0
0

Hi everyone.

 

I am trying to perform some statistical analysis on an array of dice rolls. 

 

As can be seen from the image below, I habe successfully produced a series of random dice rolls, with the user specifying the number of dice rolls desired. It is output as an array. I am trying to calculate the frequency of each dice roll, e.g. the frequency of 1s, 2s, 3s etc. I am currently struggling. I tried using the histogram VI. Any suggestions?

 

Dice Error.png

Calibration VI

$
0
0

Hi I'm new to labview programming.

 

I'd like to create a VI to calibrate a temperature sensor. With the resources what I have I'm able to measure voltage fluctuations from the sensor. I'd like to convert them to respective temperature reading. For this I want to create a VI with which I can create a curve representing temperature for corresponding voltage value. Any help in this regard will be greatly appreciated. Thank you

clear arrays pragmatically

$
0
0

Dear all,

 

Does it exist a method such has IMAQ Dispose for arrays? 

I have a VI which receives several big 2D arrays (interface requirement). These are converted into IMAQ images and processed. In the last step of th VI resulting Images are again converted and returned as 2D arrays.

I would like to dispose the input arrays once they have been converted into images and thus liberate memory usage. Is there a way to do this pragmatically?

 

Best regards,

Esteban

ActiveX cursor to end of word document

$
0
0

Hi All
I am working with LabView 2014 and MS Word 2007

Using ActiveX i have managed to copy required sections (tables/images NOT text) of a Word document template to clipboard. I have checked this by manually pasting the clipboard into a new word document.

However I need to programmatically paste the contents of the clipboard to the end of a word document but cannot figure out how to set the cursor position to the end of the word document ready for pasting using activex. Does anyone know how to set MS Word cursor position to end of document using ActiveX?

 

Thanks in advance.

Viewing all 68997 articles
Browse latest View live


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