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

Two Aplications on thecame PC Ethernet problem

$
0
0

Hello All 

 

I Have problem with running two application witch Ethernet communication to devices on one PC. 

First app is connecting to multiple devices over Modbus TCP 502 Port 

Second app is connecting to different set of multiple devices over Modbus TCP 502 Port 

When first or second app is working by them self all is OK 

When first app is working and i start second app i get error

"The network operation exceeded the user-specified or system time limit."

 

There is same setting should i do to use this configuration ? 

 

Best regards 

 


Error 5001 with MPU6050 and Servo write LINX

$
0
0

I write a simple program to red a MPU 6050 using and Arduino Mega 2560 and the LINX library, I also include in the same the blocks to control two servo motors, but when I execute it it runs well for a while but after some time it fails and throws the error:

Error 5001 occurred at :

Read.vi >>
I2C Read.vi >>
I2C Read.vi >>
Send Command.vi

 

Possible reason(s):

A timeout occurred while waiting for the Arduino Mega 2560 to respond

 

And I couldn't find a solution for this, I already changed the pins and still fails 

Here is the VI

 

snippet3.pngVI

 

Captura de pantalla (66).pngFront panelI also tried to change the baud rate but still getting the same message, the only way I didn't get the message was deleting the open servo block, but without it I couldn't write the signals to them. 

If a execute it in separated programs, I don't get the error only when I place all the blocks together.

Como hago un togle a un boton con la tecla enter

Time Synchronization Between Multiple Sensors

$
0
0

I am working with a VI right now that is trying to read from multiple sensors (a force sensor via Arduino and a position/motor sensor, both serial) of varying sample frequencies and plot this sensor data all on the same time axis. The problem I am having is synchronizing all the sensors so that they acquire a sample at the exact same time. Currently, I have parallel while loops running where each while loop is reading from a single sensor. I have added a time stamp VI in each loop at the moment the data is recorded and then export all the sensor data to an excel sheet once the code is finished and plot the data with the time stamp as the X-axis. I notice that there is a slight delay (~10ms) in the force being recording versus the position being recorded (mm).

 

I am looking to investigate the best ways to synchronize these two sensors so that they record data at the exact same moment. Using the DAQ devices is not possible for my application. Is there a way to do this or has this been done? From reading the forums, it seems that syncing the data to a an external sample clock as reference might work, but I haven't the slightest clue where to start. Any information for time synchronization in data acquisition in Labveiw would be greatly appreciated, thank you.

 

I will post an example of VI shortly as well.

Issue adding some shared variables to the added variable list

$
0
0

Hi,

I have created a fully functioning V.I and I have used it as a server V.I in a new project. 

To create my shared variables I am selecting and adding each of them to the added variable list. I have 21 items in total (they are Boolean and DBL), 19 of the 21 are adding no problem but when I select any of the other 3 the "add" button greys out (see pic) and I cant add them to the list.  2 of the items are Boolean indicators and the other is a numeric indicator.

These items are important to my project, whats causing this problem?.

 

Thanks.

LVlib tangles project file

$
0
0

I tried to add an lvlib (downloaded from the web) to my project to use the .vi files within it. I didn't know what I was doing and taught the project file some bad paths. Now I'm trying to set things straight, and the conflicts refuse to resolve. No matter how I organize the file structure within my project folder, nothing goes right.

Here's the structure, using auto-populating folders.  Power Requests.lvlib is the "holder" of Power Create Request.vi and others:

lvlib 4.jpg

If I try to open one of the Power .vi files, I get this but for the .vi:lvlib 1.jpg

And if I tell it to open the one that really exists, I get this:

lvlib 2.jpg

If I try to resolve conflicts on one of those files, I get this – and by no manner of means can I

get it to accept ANY path for the .lvlib file. Only the selected path actually exists.

lvlib 3.jpg

What is the correct file structure or method for including an imported .lvlib into a project to use it? And how can I get it to FORGET everything it thinks it knows about paths to that library, to start afresh?

 

Which is the best way to share control value in front pane among threads?

$
0
0

There are about five or six threads(that is, five or six while loops) in my diagram and all the threads are designed to get the ability to read the value of control in the front pane(partial or total) to finish calculation and configuration. 

Now I am using the local variables to achieve the goal and I feel that is an easy way but the way seemed not to be recommanded for some disavantages which I don't know very clearly. So I wonder is there a better way(s) to achieve?Thx!!

How to develop HAL?

$
0
0

I need to develop a HAL for my new project. I have already looked into the documentation and resources available from NI and the community but my LabVIEW knowledge isn't enough it seems. The best I can do at the moment is to develop a QMH. But looking at the examples provided here:

 

https://forums.ni.com/t5/Example-Program-Drafts/Applying-Common-Object-Oriented-OO-Design-Patterns-to-LabVIEW/ta-p/3510571?profile.language=en

 

Makes me wonder how can I get to such level!

 

The presenations and the examples are made for someone who has in-depth programming experience or has already played around with the implementation of HAL. I however has none of that and would like to know what are the steps I need to follow, in order to be able to develop a HAL for my project. A question I would like to be answered is whether I need an extensive knowledge of OOP or not?

 


Error 20013 Using Filter+Peak detector

$
0
0

Hello, 

I have this error when i try to filter my signal (Sample rate : 5000), when i remove the filter, i have no more error! 

I tried to change the width but i still have the same error

Any help please? 

 

filtre.PNG

Read and write from excel to excel

$
0
0

Hello, I'm not a labview programmer, but as part of a study, I need to create a small program that opens an excel file, will pick the width and height values (columns F and G) according to my part number (column B) and write them to another file. I tried to manage alone with the read or writte spreadsheet tools, but I can't. Does anyone have an example?

 

 

Instrument Control using sequence structure

$
0
0

Hi Guys,

I am trying to control a three axis machine movements using a sequence structure.

 

Suppose If I have to move x-axis from the current position to end position I make the machine to reach end position at 5 intervals, in case if I change the count to 3, it reaches the end position at 3 intervals. 

 

The problem is I can do this by changing the code every time, but I have to make it user-defined. I use a sequence structure inside a state machine. And based on the no of intervals the sequence structure has to be placed. now the issue is I can change the x,y and z to move at any positions but not the intervals and make them stop at different no of positions as it is fixed. Example now I want the machine to reach end position at 4 intervals not at 5.  And I use a for loop and control the no of iterations for the intervals. I have also attached my VI, is there any other way to get around this and able to control the no of intervals.

 

Thanks in advance for any assistance.

Save data to file outside of while loop and collect time in sec

$
0
0

Hi, I am new to Labview and working with a project, where I want to collect data from different types of sensors and handle everything from the front panel. 

 

At this point, I already have set up one sensor (Linear potentiometer), which is chosen at the dropdown panel in the top. (see attached file-Sorry for all the Danish words) (At this moment the other ones are empty)

 

My program allows me to choose which port from my DAQ the sensor is connected. Thereafter calibrate the sensor and reset to a starting point. 

The data to save is distance moved, min and max value for this sensor. 

 

1. The problem is, that I want to log the data. But when I write my data inside a  loop to a file. It writes for each iteration. If I move it outside the loop, nothing gets written. How do I solve this, so I can get a continuous log for the collected data? 

 

2. Also, I would like to have a timer going inside my loop, so it is visual for how long time the program has run. This timer shall also be used to show when my value of Min and Max is stored. 

 

Is there a kind soul to explain/show how to solve these problems?

 

If anyone has some good ideas for my project I am interested to hear your suggestions.

 

best regard 

Morten

 

Switching multiple subvi back and forth in Subpanel whithout closing them

$
0
0

On my main vi I have two OK Buttons(OK Button1 and OK Button2) and a subpanel. I have two subvi Sub1 and Sub2 both have a while loop running with some front panel control. 

I want to load Sub1 when I click OK Button 1 and Sub2 when I click OK Button 2. But the condition is when I load Sub2 my Sub1 should not get close, it should go to background and keep running so that it may pop up again when I press OK Button1. 

LabVIEW compatibility

$
0
0

Hello everyone, 

i am using LabVIEW for the first Time and have a question.

it is possible to a LabView code from a old version (in this case from LabVIEW 51.1) to a new version?

Thank you for your answers.

Adding values to array without overwriting

$
0
0

Hi

I am facing a problem as stated below.

I have an array a=[0.5 0.2] and another array b=[1 2]. Since b[1]=1, I have to repeat a[1] 4 times (3*b[1]+1) and since b[2]=2, I have to repeat a[2] 7 times (3*b[2]+1). The final array would be

c = [0.5 0.5 0.5 0.5 0.2 0.2 0.2 0.2 0.2 0.2 0.2]. I would like to program this in Labview, without a formula loop. Any help would be highly appreciated.


Return to line when writing on a text file

$
0
0

Hello to all, 

 

I am using a producer-consumer pattern in my VI. The producer computes several data (27 data) and passes them in a queue (the data are converted to string before). 

 

The consumer has to write each data in a text file. When the producer sends 27 data, it means one cycle has been completed.

I would like to write one line per cycle, meaning each time the consumer writes 27 data, it has to go on a new line (send a new line instruction).

 

I tried to write "\n" to the file to go on a new line, but it doesn't work, it simply writes "\n" on the text file.

 

How can I make a new line on a txt file?


Thanks

several USB connection

$
0
0

Hi,

I use two Conex CC (controller) for command my stages (X and Y), so I added the library CONEX. I created one connection for each controller (Connect Newport Instrument.vi) but my problem is my connection is not in parallel, I have two loop one for each controller but I can't run the both loop in the same time. I would like to know how I can run these loop in the same time ?

Generating signals on Trigger interrupt with HSDIO PXI-6451 module

$
0
0

Good afternoon,

I am using a HSDIO 6541 module to generate and acquire SPI signals from a FPGA. The acquisition should be synchronized with an external CLK which I physically wired to the PFI 0 input.

 

I created a .HWS file using Digital Waveform Editor and used SignalExpress to send this signal on every falling edge of the PFI 0 input through the Trigger Tab. Unfortunately, the SPI signal is only send every 116 falling edge.

 

I have tried changing parameters here and there, but just can't seem to have it work ! Here is what I am observing. (MOSI, SPI_CLK and CS are generated by the HSDIO module, RTC is what's connected on PFI 0 and MISO is generated by the FPGA).

 

HDSIO--00002.pngHDSIO--00003.pngHDSIO--00000.pngHDSIO--00001.png

 

I have tried doing the same thing on Labview using NI-HSDIO Express (Generation) and observed the same behavior...

Do you have any idea of what I'm doing wrong? Please find pictures of my code attached as well as the .HWS file.

I am also curious as to why the CS remains high for a few us but that is a different problem.

Thanks a lot in advance for your help,
Hugues

Convert IMAQ Detect Rectangles rectangle to ROI descriptor

$
0
0

I am having trouble converting the "Rectangles" cluster output from "IMAQ Detect Shapes VI" ("IMAQ Detect Rectangles") to ROI Descriptor. The "IMAQ Convert Rectangle to ROI (Polygon) VI" accepts a different type of rectangle cluster.
I have tried using "2D Cartesian Coordinate Rotation VI" to rotate the coordinates and create the rectangle cluster as an input to "IMAQ Convert Rectangle to ROI (Polygon) VI" but the final ROI does not match the coordinates I started with.

LabVIEW code ramifications upgrade from B series DAQ to M series DAQ

$
0
0

We have a LabVIEW automated test system that was developed by a third part many years ago using a PCI-6014 B series device. I need to replace the device and the 6014 is no longer available. What issues might I run into if I upgrade to a PCI-6221 M series device? Will the virtual instruments still work the same? 

 

The .vi's were written in LabView 8.0. For signal generation and measurement AO Write, AO Start, AO clear and AI acquire code blocks were used. 

 

Thanks!

Viewing all 69204 articles
Browse latest View live