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

how to control timing in analog output task

$
0
0

Hi all,

    I created a vi using analog output task using usb 6211 and AO0 has to increase the voltage gradually based on the control value and AO2 has an fixed value and now i need to increase the AO0 output in a certain interval or per second here i have used wait(ms)function to control the timing but is there anyway to use timing DAQmx timing.vi to control the output because if i use wait(ms)function it affects the other code here i have attached you the sample code so that you can verify.

regards,

paul


Optimizing an objective function (Holt's exponential smoothing)

$
0
0

Hi there,

I should create a programm carrying out Holt's exponential smoothing for a raw data (https://en.wikipedia.org/wiki/Exponential_smoothing#Optimization). I've managed to create a block diagram for the case when parameters alpha 1 and 2 is entered by a user, yet the next step is to make up a program calculating alphas itself by optimizing an objective function (SSE, the sum of (y-y')^2, y - raw data, y' - data by smoothing). 

I tried to use Optimization VIs, but there's no result, since in all cases there must be the model described, and I haven't a clue how to make a description.
There is a snippet attached, but it's a little cluttered, sorry for it.

Dashed line on a XY graph

$
0
0

I am not able to select the dashed line from Lyne Style. LV 2015 SP1 32 bit doesn't allow me to do that. Is It a bug? Have you any suggestion to force LV to accept to make a plot with the dashed line selected?

DVR question

$
0
0

Hello guys,

 

Iam having what i would like to think is an unsuspected behavior on on a function (1D dbl array circular buffer) that contains DVRs.

i decided to use DVRs because i need several of these functions for different processes on my sw.

I initialize three DVRs of the same function

here is some details:

a loop that runs 10 hz fast 

every run i read from hw a 2D array (5 channels 5 samples/channel) and convert this 2D array to 1D array of 25 elements and add it circular buffer DVR # 3.

every 10 reads i then i jump to another loop by triggering an event and i attempt to read this function and log this data to disk.

i expect to see 225 data after i filter 0's.

 

what it is happening is that for several minutes I get the expected samples but then it only yields 25 samples and never recovers from that.

pic-1.png

Any ideas why Iam getting what seems to be only one run worth of data?

 

thanks in advance.

 

Generating 2D Boolean Array 12 bits per row from a 8 bits per row given initial sample

$
0
0

Hey guys first time poster I have been stuck at this point for a couple days now.

Im trying to take a 24 bits per row 2D boolean array sample i've reshaped from originally 8 bits per row, just repeated the 8 bits 3 times over to get 24 bits per row.

 

Now my problem is when I'm trying to convert this 24 bits per row 2D array into a single 2D array that consists of one 12 bit sample per row. It would generate this 12 bit sample from the 24 bits per row and would consist of the first 12 bits from the 24 bit per row 2D array in the first row and the 2nd row would have a particular assortment of the 24 bit row 2D array which I have indexed in my VI. And this combination would repeat. 

 

Now really sure how to build the single 2D final array from my 24 bit per row array. And I know what the end result 2D boolean array should look like based on this initial sample and im not close. Need help at that point. 

 

Ive attached my code to help explain but any help about my situation would be awesome!

 

Thanks.

How to use SubVI replace invoke node in VI scripting?

$
0
0

Hi,

What I want to achieve was to change a VI's every SubVI's name programmactically.

For example, I have a VI called Main_tst1.vi. It called two VIs: tst1_init.vi, and tst1_close.vi. 

To change their name to tst2_init.vi and tst2_close.vi, I first copied tst1_*.vi to tst2_*.vi using "Copy" vi under Adv File Functions. Then I ran the code in the caption below:

 

Replace SubVI.png

 

I expected the next time I open Main_tst1.vi, its subVIs would become tst2_*.vi. However, they remained tst1_*.vi. 

Can anyone tell me where I did it wrong and how to fix it?

 

The VI in the capture and a folder containing the VIs to rename are attached as a zip file.

 

 

Thanks in advance!

Change the color of a latch boolean

$
0
0

I'm currently trying to change the color bindings of each of the latch stages of my boolean button (settings).

 

It's currently on the "latch when released" mechanical action. The button brings up a popup window that asks for a settings for my current program, however, when I click done or cancel to the pop up, the button color stays in depressed mode  color.

 

I tried following this link: http://digital.ni.com/public.nsf/allkb/195C63E6E96FE93386257B9D00493067

 

to change the color of my latch boolean button, but when I get to the customize window and use the "set color" tool, it won't let me change the color of the latch stages.

Is there a certain process I need to do before I can change the event colors?

 

 

 

Unpressed.PNG Settings button is grey before pressed

Depressed.PNG Stays blue after the pop up window is closed.

Write this program using Matlab


Does anybody have a code for rubik cube solver robot?

$
0
0

I built a LEGO robot, which almost a same as this:

http://mindcuber.com/mindcub3r/mindcub3r.html

 

I'm a beginnier and the color reading part is done, but the main program is very hard for me. 

I very appreciate if someone have a similar VI and could send me.

RS485 communiciiton via USB-RS485 convertor

$
0
0

 Hi all,

 

I have a system where I need to read/write from multiple RS485 devices via NI-VISA. I am opening the com port that is connected to USB to RS485 converter and have for this test 2 RS-485 devices that are connected over that bus (I am using unique ID's fro each device so when I send it over the bus ONLY the device with that ID is responding). When using only one 485 device there is no problem and I continuously read and write to that device over the bus. But when I have two devices it starts working OK but after some time it seems that one of devices is not responding and the loop is hanging while waiting for Number of Bytes at Serial Port. I have discovered that if I send again the same command ID then I receive the answer from the appropriate device. Each device is sending first 6 bytes header with info how much bytes it will send. 

The sequence I use is: Write to COM port 3 bytes that identify the device ----->>> Wait for Number of Bytes at Serial Port----->>>Read the answer from that Device->>>> than same for the second device and loop again.

 

Why is this happening? Any ideas?

Thanks,

ERROR 1003 OCCURED AT INVOKE NODE

$
0
0

Hello all , 

i have Designed  a VI which calls the another VI . error 1003 continuously occurring and saying " The VI is not executable. This error may occur because the VI is either broken or contains a subVI that LabVIEW cannot locate. Select File>>Open to open the VI and verify that you can run it. " 

 

i am new to this language . post your ideas 

Flushing TDMS file without creating delay

$
0
0

I have a problem where my datalogger has to run for extended periods of time (days).

To prevent loss of data in case of computer crash, I would like to flush the data into to TDMS once every 15 min.

 

The problem i have is that every thing I have tried so far results in a increasing delay between real time and the latest sample (the logger lags behind).

After 3 days of logging its about 10 mins deviation.

 

The file takes a starttime, and number of samples and multiplies it with dealy between samples to get supposed time and date.

I'm assuming it skips a few samples every time it saves the file and therefore it won't have enough samples.

 

So far I've tried closing and opening a new reference, flushing, flushing in a seperate vi parallell to the main vi.

 

If anyone has any experience in this I would be glad to know if there are any tricks to this.

Separate VI for GUI and Main programs: Using global variables to share data

$
0
0

Hi,

I'm newish to labview (only done core 1+2 courses) and have recently been assigned the project of writing labview programs for our engineering test labs. 

The common format used there is to separate the 'Main' program (which performs the computation, calls subvi's etc), from the GUI.vi user interface (which only displays data, does not include any loops, calculations etc).

Global variables listed in the project window are used to share data between Main.vi and GUI.vi; for example booleans (start stop), numeric data etc.

 

The issue is that as the complexity of the GUI grows the list of global variables increases, adding what may be unnecessary complexity to the program setup.

 

1. Is this a common layout, or can anyone advise why it has been done this way for several years by previous employees here?

2. Is there an alternative to using global variables which might reduce the size of the list that needs to be shared? Perhaps clusters of elements, or arrays of data?

3. Would you recommend an alternative structure: perhaps just using the front panel of Main.vi to display all the data? Are there disadvantages to not separating GUI and Main, or is using the front panel of main a common layout for larger more complicated program structures?

 

Interested to receive your feedback.

 

Thanks in advance

 

Aborting execution of Flat Sequence Structure

$
0
0

Hello, 

 

With reference to the attached VI, how do I abort the ongoing Flat Sequence Structure execution either by switching of the 'Selection switch' or by 'Stop' button?

 

As I see, when the 'Selection switch' is put to OFF, it will complete the ongoing execution and then go the 'False' case. And, when the 'Stop' button is pressed, apart from the ongoing execution, another execution of the sequence takes place before the VI stops. Reason for this? 

 

Note: Please put a few second delay in between the LEDs. 

 

Off topic: I do save the VI with the timer values. But when I reopen the VI, those values will be reset to zero. How can I retain those values upon next opening?

 

Thanks. 

Sub vi quits when stopped

$
0
0

Hello everyone,

 

I have a main code that calls some sub vi's using reference. The sub vi opens properly and works just fine.

 

When I press stop on the front panel in the exe, the sub vi is supposed to just stop and not close its front panel as there is no such code inside the sub vi. But the front panel still closes. This does not happen if I run the code (the vi) on the same computer. I guess there must be some settings I need to do when I create the exe. I have used LabVIEW 2014 64bit on windows 10, 64 bit.

 

Any help with this is appreciated.

 

Thanks a lot


Delete character from string

$
0
0

Hi 

I have string as shown

 

PROGRAM  = PASSED , XT ID  = PASSED , VERSION  = Abort , Temperature  = Abort , IDLE Current = Abort , ON_Current  = Abort , IMEI = Abort , SIM = Abort , GPS Ver  = Abort , GPS C/N  = Abort , Motion X  = PASSED , Motion  Y  = PASSED , Motion Z  = PASSED , vib Motor  = Abort , LED  = Abort , Tamper LGT  = Abort , Tamper DRK = Abort , MIC_Tone_Frequency  = Abort , MIC_Tone_Amplitude  = Abort , Ambient = Abort , Transceiver(BER)  = Abort , CHG_Current  = PASSED , Hall = Abort , Speaker = Abort , LCD Backlight = PASSED , STimer = Abort 

 

as you can see the string contain Test = result , Test2= result 

what I want to do delete each test that contain abort I want to delete 

example version= abort I want to delete also S TIMER= abort 

 

thanks very mush

 

 

Mathscript node installation

$
0
0

I am unable to find link for Mathscript installation for LABVIEW 2013. I found Mathscript version for 2014 and so which are incompatible with 2013.

 

Please help me out with this.

Same LabVIEW exe different behavior

$
0
0

I am trying to run an .exe file on my laptop to control a Keysight UXA.  Part of the code works properly, but other parts are unable to be executed.  No error message is given. 

 

Same .exe file, however, works fine on other desktops and laptops.  The labVIEW version on all machines is 15.0f2.

 

Appreciate any suggestions to find the problem.

 

delete character from string - type2

$
0
0

Re: Delete character from string - Discussion Forums - National Instruments

Hi 

I have string as shown

 PROGRAM  = (1,1) , XT ID  = (35612345,35612345) , VERSION  = (V5.12.7.1,V5.12.7.1) , Temperature  = (75,85) , IDLE Current = (0.03,0.06) , ON_Current  = (0.04,0.08) , IMEI = (358683068194647,358683068194647) , SIM =(Abort,Abort) , GPS Ver  = (GSD4e_4.1.2-P9_CCK F,GSD4e_4.1.2-P9_CCK F) , GPS C/N  = (38,60) , Motion X  = (50,360) , Motion  Y  = (50,360) , Motion Z  = (50,360) , vib Motor  = (1,1) , LED  = (1,1) , Tamper LGT  = (600,900) , Tamper DRK = (0,10) , MIC_Tone_Frequency  = (3230,3260) , MIC_Tone_Amplitude  = (3230,3260) , Ambient = (1,1) , Transceiver(BER)  = (0,0) , CHG_Current  = (0.3,0.6) , Hall =(Abort,Abort) , Speaker = (1,1) , LCD Backlight = (1,1) , STimer = (1,1)

 

as you can see the string contain Test1 = (min limit,max Limit) , Test2= (min limit,max Limit)

what I want to do delete each test that contain (Abort,Abort)

example Hall =(Abort,Abort) I want to delete 

 

thanks very mush

LabVIEW won't open files after copying folder from network

$
0
0

I have a project that I completed a year ago and uploaded the entire project folder to the network. In the year since I completed the project, my computer was upgraded to Windows 10 so I don't have the project folder on my hard-drive. I need to make some changes to the program so I downloaded the project folder to my hard-drive. I opened the project and it opens fine. When I try to open the main.vi I get an error message. the error message says LabVIEW failed to load dynamic library (attached error message) for several controls and VI's. 

 

 

I then deleted the folder that I downloaded onto my hard-drive and tried to open the project from the network folder, but I get the same error messages. Am I missing something or did I screw something up? I believe I have a copy of the software on a thumb drive, but I'm afraid to open it now until I find out why I can't open the files. 

 

Viewing all 69272 articles
Browse latest View live


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