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

Attaching a Physical Switch to start/stop Analog Data Acquisition

$
0
0

Hello Everyone,

 

I am using an NI 6002 to gather voltage data across two channels. I want to attach a switch to the system allowing me to write data by pressing a physical button. Write data when the physical button is pressed. Stop writing data when the physical button is released.

 

It is my understanding that I cannot have digital and analog together in the same task so I separated them to their own respective tasks. The NI 6002 is specified to 5V, so in order to trigger the system I have supplied the 5V though a battery. Here is the switch circuit I used where the light bulb in Digital Channel 0. When I pressed the button it does not write to my VI. Instead I get error Property Node DAQmx Trigger (arg 1) in DAQmx Start Trigger (Digital Edge).vi:3930001.

I think I am super close, but I just can’t determine what I am doing wrong.

 

Attached is my VI

Any advice would be appreciated!

Thanks


myRIO ground

$
0
0

Hi all,

 

I just want to ask if there is a difference between the AGND and DGND ground pins of myRIO. Are they the same? Or there is a specific or special applications for these pins?

 

Thank you.

Inverse Z transform

$
0
0

Hi,

Please help me to implement the below equation in LabVIEW without using math-script module.

1 + 0.41 Z^-1 + 0.33 Z^-2 / 1 - 1.53 Z^-1 + 0.87 Z^-2

 

Thanks in advance for your help.

Using PID with a quadrature encoder to control angle

$
0
0

Hello,

my team is trying to use a PID with a quadrature encoder to control how much our robot turns. 

Does anyone have any example code we could use to start? Note: We don't have NI-DAQmx.

Timeout in waveform graph(cut out some data from chart)

$
0
0

Hi,

I prepared drawing data from binary file to mixed waveform graph,

and honestly, I have no idea how to mark timeouts of signals(for example if the devices is off for some time during saving data to binary).

 

Client wants me to mark a timeout(time without communication with the module) as I show belowobraz.pnganyway, anybody knows if it possible??

 

All what Ive tried so far changed entire plot color. Is it possible to change only the part of the it?

I dont want to draw second plot marked as black to cover it... and the client doesnt want to agree to take data to zero as showed below

obraz.png

Now I am wondering if I should try with Xcontrol(but I dont believe to find solve it in that way)

 

 If it is impossible I am ready to write it in c# or other language and import as .net, but it will take a lot of time to make it from the beginning. Labview costs too much to use other languages apart from it;p.

 

best regards,

M

How to create custom subVI

$
0
0

Hello all,

       I started searching if its possible to create a subVI capable of changing its own inputs/outputs based on

selector of its own. For example, the main input of this subVI is a CONTROL Selector (like an ENUM Constant)

and when I select one of its options, automatically the subVI enables and shows certain input/outputs that

corresponds to the option select. So, inputs/outputs of subVI will change when different option is selected.

 

Does anyone know if this is possible? If it is, can you share the knowledge of how to do it? I'm debugging and

a program, and this will come in handy.

 

Thanks to all, I appreciate your help!.

 

Chirp Signal Triangular for FMCW

$
0
0

hello everybody, i;m from ITB university. I will make a chirp signal from a triangular. Can someone help me to give a example labview program? Pleas. I hope everyone can help me. Thank;s so much..

optimize an application

$
0
0

Hi Friends,

 

In my application, I have a for loop that checks each row of an array and overrides a given field according to a rule. This application shows the results through a table. However, according to the amount of data, this check is taking too long! Is it possible to optimize this? For example, in a query to the SQL database, it is possible through an UPDATE talbe SET, to replace fields of an entire table virtually instantly, even though it has millions of data. However, through my application, every ten lines checked took almost 1 second to make a ridiculous rule of average .......

Thanks

LabVIEWでのマスフロコントローラー流量読取り制御についてです

LabVIEW YMODEM file transfer protocol via RS-232 port

$
0
0

Hi folks,

 

Recently I come across a project that requires me to load firmware to a device via RS-232 using YMODEM protocol. I could do it via TeraTerm, however, TeraTerm pops up annoying windows during the operation. Hence, I would like to use LabVIEW so that everything is under the control.

 

Unfortunately, LabVIEW does not provide any module that can transfer file using YMODEM over RS-232. I have studied the YMODEM protocol myself, and the protocol is summarised as below:

 

SENDER                                                                                    RECEIVER 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<              C
SOH 00 FF "foo.c" "1064'' NUL[118] CRC CRC >>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<            ACK
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<               C
STX 01 FE data[1024] CRC CRC>>>>>>>>>>>>>>>>>>>>>>>> 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK
STX 02 FD data[1024] CRC CRC>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK
STX 03 FC data[1024] CRC CRC>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK
STX 04 FB data[1024] CRC CRC>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK
SOH 05 FA data[100] 1A[28] CRC CRC>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK
EOT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             NAK
EOT>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<               C
SOH 00 FF NUL[128] CRC CRC >>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<             ACK

 

I can write command to COM port and the device returns ASCII string "C" to indicate that it is ready to receive file transfer. According to the protocol, I need to send "Header info" as block 0 which is:

 

SOH 00 FF "foo.c" "1064'' NUL[118] CRC CRC

 

I checked many example code in other programming languages, i.e. C#, C, people just write to COM port with "SOH", "00", concatenate("FF", "foo.c", "1064"), CRC[2], one after the other, everything is in byte data type. However, LabVIEW "VISA Write" VI only takes string as input.

 

I have made the VI that reads my .bin file to convert them as 2D byte array, because I need to split the file into 1024 bytes blocks as required by the protocol. Also, I have made the VI to calculate CRC based on the each data block. Then I send them one after the other as described above. As mentioned, the "VISA Write" VI only takes string input, hence, I convert the byte data array to string using "Byte array to string" function before sending.

 

Now I am stuck at the last stage where I need to send an empty data block to indicate that there are no more files to be transferred (YMODEM is batch file transfer protocol). After after sending the first file, I sent "EOT" to indicate the first file is done and wait for "C" from the device to tell me that it is ready for second file. Then, I have sent the data block formatted as follow to the device to tell the device I am done with transferring the files:

 

SOH 00 FF NUL[128] CRC CRC

 

After this step, instead of sending me back "Done" from the device, it sends me "Failed to receive the file!".

 

I have no idea what is wrong with my LabVIEW code. Other third party software is able to successfully transfer the file to the device. Could anyone help me to debug? Thanks in advance.

 

Jacky

reset issue with my sub vis

$
0
0

Hi 

 I have attached my vi, in that 3 machine monitoring are there, while first machine have the input, its start running and show green. if the input is not go high with in the 7 sec, it show red

but other two machines are idle

 But i turn on the other machine for the first time its shows suddenly red

please help me out 

please correct my vi 

for sa 1 count = 1 cycle

for fa 5 count = 1 cycle 

i have connected the vi properly but 1st machine input updating on 2nd machine output

open gggg. vi first remaining all sub vis

please correct my vi

Help with name (string) to number (numeric) program

$
0
0

I need to make a program where I can write a number on a numeric control and it will be displayed the name of the number on a string indicator.

example:

 

Write: 10, or 20, etc

See: Ten, or Twenty ,etc

 

And on the other hand write in words the number on a string controller, and display the number on a numeric indicator. 

example.

 

Write: Ten, or Twenty ,etc

See: 10, or 20 ,etc

 

Thanks for the help, greetings!

Pointer slide controls to select iteration numbers of data subset and display in another XY graph

$
0
0

Greetings.

 

I am having trouble with, as mentioned in the subject.

 

I need to use 2 slide controls to control how data is displayed in second graph (Data Section) graph in the vi, based on the data file (teste.csv) that has been read in the first graph (EEG data). 

 

Do you think that I need to put shift register in the For Loop so that all iteration of data can be accessed?

 

if not, can you please suggest me the step by step on how to achieve my aim. Please refer to the vi attach.

 

Looking forward for your help.

LabVIEW Project not loading- stuck on RGT VIs

$
0
0

Hello all,

 

recently I've been fighting with a problem: I can't open one of my projects as it gets stuck on one of the report generation toolkit VIs upon loading. This happened both before and after a complete reinstall of LabVIEW. I've also tried doing a mass compile, but it gets stuck on those same VIs.

Eventually, the project will open, if I try enough times, which I only tried as I noticed that it getting stuck on different VIs each time, but obviously that's a nuisance.

 

It usually gets stuck on:

_office\exclsub.llb\...

_office\wordsub.llb\...

 

Where do I even start debugging this?

OOP architecture for device driver

$
0
0

Hello everyone,

 

I am writing to get help/support for my OOP architecture. Here's the context:

In my company we produce 4 devices for which we have libraries in ActiveX format, that we call from LabVIEW with "Invoke Node (ActiveX)" VI. The 4 devices are very similar, and the libraries as well (I'd say 95% of the functions are identical), but they are still distinct ActiveX objects.

To use the library, I create a refnum cluster (each library actually contains 5 sub-libraries so I have a cluster with refnums to all 5 sub-libraries)

I often have to run tests on Device 1 (D1), and later switch to another device D2 (hence another library) but with almost the same test. Therefore I change the reference to the library for D2 and all the Invoke nodes update automatically to the new methods (for D2), since methods in library for D1 and D2 (and D3 and D4) have the same names (except for some outliers).

 

As calling methods through Invoke Nodes is pretty ugly in a main VI, I created subVIs for each ActiveX method. Inside, it's pretty simple: cluster with refnums to libraries, Invoke node and inputs/outputs.

Now the issue is that if I want to change the library reference in the main VI, the subVIs don't update automatically to the new reference (since the cluster of refnum to D1 is not the same type as cluster of refnum to D2 for example).

 

My idea is to use OOP and create a parent class that will define methods for each ActiveX function, and children classes for each device, that will inherit methods from the parent class and only override what is different or missing from the parent class.

 

Problem:

I need to use a "generic" reference in the parent class in order to use Invoke Node in the parent methods. For now I use the reference to D1 but would like to have a generic reference. Is it possible?
In a traditional inheritance, when I create a child instance, I would overwrite the parent's reference. However, here it is not possible, since the parent's reference and the child reference are clusters of different type.
My solution for now is to override each parent's methods with child method (Create VI for override and then replace subVI with contents), but that is not good reusability and upgrades (if I want to update the parent method, the child method won't update).
I don't know if I am clear enough or if I miss the point of OOP. Let me know if you need more details or examples.

 

(Using LabVIEW 2017)

 


Vi Server - Open Frontal Panel remotely. Error 1043

$
0
0

Good moorning,

 

I'm trying to open a frontal panel of a .vi through vi server fuctions. 

But, I'm obtaining an error. 

 

error 1043 : Error 1043 occurred at Invoke Node in host1.vi

 

Could anyone help me with this problem?

 

I'm using LabVIEW 2017 (32bits) and my remote system is a sb-RIO

 

Thanks so much. 

 

1.png2.png

 

 

Question about Arduino & Labview

$
0
0

Dear all,

I use Arduino Uno and an ADC shield ( could ask arduino receive minus signal ) as a data acquisition device. My labview version is 2016. It's a two channels signal acquisition device. One channel is the Incentive sin signal, the other channel is the Induction signal. Both Sin and Induction signal is a periodic signal. I could get the signal on oscilloscope like fig.1 below, I check the serial monitor works well and the result looks like good enough, but I could not understand why I couldn't get the same display through Labview.

 

fig01.jpg

 fig.1 oscilloscope display

Always I got the same value to display in a loop. I considered if the connection between VISA read and display was wrong, this part you could found in the below post file ( I use this for loop in order to enhance the sampling numbers, the frequency of my incentive sin signal is 1Hz, without this for loop inside the arduino code the delay will decrease the sampling number so my idea is adding a for loop enhance the sampling number because after reading 300 serials there is only one delay for 1 ms. )

fig02.png

fig.2 Internal for loop structure

The connection especially inside of the for loop may have something wrong, could u help me? Thx.

With best wishes,

Andy

LabVIEW Real-Time Target setup: "PXE-E51: No DHCP or proxyDHCP offers were received"

$
0
0

 Hello all,

 

I've been trying to set up a LabVIEW Real-Time target on a PC solely dedicated to the purpose.

I've created a bootable USB drive following the steps in the following guide: http://www.ni.com/tutorial/2733/en/ .

 

After verifying and passing the system requirements with the use of the provided utility on the stick I tried to boot into safe mode.

Unfortunately this did not work. Nothing happened and I had to shut down the machine manually.

 

When I now restart the computer and try to enter the setup as before the machine shows its MAC address and tries to establish a link using DHCP. This fails and I get the following error: "PXE-E51: No DHCP or proxyDHCP offers were received" .

 

Why doesn't it boot from the USB drive as before so I can retry booting into safe mode and go on with the setup instructions?

How can I reset the behaviour to its default settings?

 

Has anyone had this problem before and knows how to fix it?

 

Many thanks in advance for any kind of help or even a pointer in the right direction....

 

problem open xml file

$
0
0

Hi, i'm using labview as beginner in labview application. I started to load and interpreter a simple xml file with labview and classical VIs object for xml treatment. I realized my project, i found the nodes correctly, but i have a problem to extract the child and sibling elements of a node. Could anyone suggest me ho to extract a list(sibling) of childs from a node? 

So i have to search if exist a block to open a file with a scheme. In labview i think it doesn't exist, correctly?

Thanks Michele 

Crypto-Tools 2014 Labview

$
0
0

Hi, 
I need to use some free crypto libraries for Labview, but I don't know how and where it adds to the current library folders.


Which steps I must follow to add new libraries in labview, to use them on the Front Panel and the Block diagram?


Thanks in advance.

Viewing all 69214 articles
Browse latest View live


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