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

myRIO - FPGA - Data Acquisition - Synchronization of two channels

$
0
0

Hello.

 

Can any one help me understand how to acquire data simultaneously from two analogue channels in synchronization?

I want to acquire two different waveforms using two different analogue channels such that the channels are reading the waveforms simultaneously such that the acquired waveforms are synced together.

as shown in dummy_values.png

 


Correcting Bad Wiring

$
0
0

Hello, I am currently trying to fix a VI that was given to me but I am very inexperienced when it comes to Labview and programming in general and I have encountered an error when I was uploading SubVI's into the program. The wiring the is incorrect because the the terminals are different types, but I do not know how to fix it. I am working with Labview 2012 because of the .NET configuration. I Attached a picture of the error below.

Developing device driver for MKS 972B DualMag - proper error handling?

$
0
0

Hello!

 

I am recently developing for our new experimental rig, where I have a couple of instruments which do not have LabVIEW driver available, but their communication protocol is well documented. My "first victim" is the 972B DualMag sensor from MKS, and later I also want to create another driver for the MKS 937B controller.

 

For my recent project I do not need to use too many features of this product, so I could just "hard code" those I need right now, and it would be a short work. However, I might need more features of these devices later, and others might also find such LabVIEW driver useful, if I create one.

 

In order to create a proper driver and follow the official guidelines, I try to follow the steps described here: "Developing LabVIEW Plug and Play Instrument Drivers"

I created the starting project using the "Create New Instrument Driver Project" from the Tools menu, and I selected the "General purpose (message-based)" option.

 

I am seeking advice what would be the best error handling strategy for this device. In the following, I will refer to pages in the attached manual (Communication protocol section starts from page 10). Some important info regarding to the sensor: I did not find any option to do Error Query, so no such command, neither option to read error status registers. The device is very simple to use, from page 10 some info regarding to the command/query/response syntax:

 

"Query and Command Syntax
Queries return current parameter settings; commands change the parameter setting according to the value the user enters into the command syntax. Each query or command must begin with the attention character @ and end with the termination ;FF."

 

Command syntax for an information query:
@<device address><query>?;FF

Command syntax for a command:
@<device address><command>!<parameter>;FF

"Response Syntax (ACK/NAK)
The ASCII characters 'ACK' or 'NAK' preface the query or command response string. The ACK sequence signifies the message was processed successfully. The NAK sequence indicates there was an error."

 

The response to a query or a successful command is:
@<device address>ACK<data>;FF

The response to a message with an error is:
@<device address>NAK<NAK code>;FF

 

"The following list provides descriptions of the NAK codes that may be returned."

 

NAK Code      Error description
8                     Zero adjustment at too high pressure
9                     Atmospheric adjustment at too low pressure
160                 Unrecognized message
169                 Invalid argument
172                 Value out of range
175                 Command/query character invalid
180                 Protected setting (locked) -
195                 Control setpoint enabled (ENC)

The generic "Error Query.vi" is shown here:

MKS 972B DualMag.lvlib_Error Query_BD.png

I wonder what would be the best way to alter this VI without changing the generic error handling idea in this generic project. My idea is the following, please comment whether this is the proper way to go, or not? Thanks! Smiley Happy

 

So, whenever any of my driver VI captures a "NAK" error response instead of a proper "ACK" response, I would generate an error into the error wire right in that place, plus calling a modified "Error Query.vi" (actually I would rename it to "Error parsing") to change the NAK code into the string part of the custom instrument error, error code -1074000000. Thus this error can propagate through any other VIs, and also outside of the driver API VIs. It is up to the programmer, if she or he wants to erase/handle/etc this driver error in the calling codes.

Populating an Array with measurements

$
0
0

I am currently working on my second LabVIEW VI, and have run into a snag.  The software will be to test the resistance of printed resistors, with several on a panel.  I would like to be able to take the resistance of each resistor, and write the resistance reading to a spreadsheet with one sheet per row.  In the VI,  the value of "Sites" is the number of parts on a sheet.  Array 2 is taking the place of the write function.  I am currently unable to get each reading to cycle into the array in the way that I would like. 

 

I'm fairly certain that I am overlooking/overthinking this as it's not all that complex.  Any comments on my code would also be welcome, as being a beginner I'm sure there are several things that could be improved upon.

 

"Pre/Post Build Actions" when building installer?

$
0
0

When building a source distribution or application (and some others), we can specify "pre/post build actions", i.e. VIs that are called before or after the build steps.

 

Sadly, this option is missing when building an installer. We can only specify executables that run before of after installation, not before/after the build process.

 

I can think of many scenarios where a "pre/post build action" could be useful when building an installer. For example every time I build an installer, I rename the created "Volume" folder to something else, and every time I edit the setup.ini file to change the  "WinFastStartup=1" to "WinFastStartup=0" (long story). These are steps before/after the build, and occur well before distribution and installation.

 

After "build all", I also move all new builds (source, exe, installer) to a new and unique folder, and since the installer is the last build, even this could be automated if we had post built action when building installers.

 

Am I missing something obvious?

 

(Of course I can write a VI that does all the builds and then applies the actions. Just wondering why the built-in tools are missing this functionality).

 

PCI-6024E DAQmx reading a negative voltage on a battery

$
0
0

I have this VI that is occasionally reporting a measured negative voltage of a battery
and I am not sure why because tis value should never be a negative value...

 

Below is a screen shot with a couple of probes and I would appreciate any ideas on how
to correct this issue

 

thanks

 ground fail.jpg

 

How do I make a boolean indicator show 3 states instead of 2

$
0
0

Boolean is 2-state.  I just wish I could make it like a stop-light.

 

Green is "go", yellow is "danger" and red is "stop".

 

Any suggestions how to do this?

Data Communication with Python

$
0
0

Hi,

I am trying to communicate with Labview using python. I based my code off of the code given here. https://forums.ni.com/t5/Example-Program-Drafts/Python-LabVIEW-TCP-IP-socket-communication/ta-p/3537049

I am currently having troubles with receiving the data. The line I get from the first call is much shorter than expected. It appears that the data is received with the second call. By the third line it seems that this is mostly resolved, except for a few extra data points that appear here and there. These points only appear from one module, so I am thinking that it has to do that the module isnt properly set up with its sensors yet. I was wondering if you guys thought that this was a software or hardware issue. If it is a software how should I fix it?

Sorry if this is the wrong place for this question. If it is please tell me so that I can place it in the correct forum. I think this is saved as Labveiw 2017.

 Also I am sorry if something is unclear, please ask so that I can try to make it more clear for everyone


Time based XY graphs code control problem

$
0
0

Hello,

I'm Trying to work with two XY time-based graphs.

The data (Y axis) is received in non-constant time intervals (And that's why I use XY graph).

My goal:

The first graph is used as kind of scrollbar for the other, displaying the whole received data over the running time.

The other graph displays an enlarged scope of the data, determined by the location of the first graph cursor location.

 

Well, I did it. But I'm very unhappy with the final result.

1) The block diagram is so inelegant (And I don't mean the mess).

2) For some reason, the second graph does not fill its entire scope.

 

Can you help me with this and find A better solution than I Added?

 

Thank you,

Ran

 

 

Help Arranging an Array of Data into an Excel Worksheet (using ActiveX)

$
0
0

Hello!

So I have a 2D array of data that I pulled from a separate file and I am trying to arrange and put into a new file but I am running into an error using ActiveX when it comes to specifying the cells I want each bit of data to go into. I do not understand how the Worksheet Range property works when given an array of cell numbers with the 2D array of data I am using. I noticed that if I only give it one cell name, for example A2, it will put my very first piece of data into that cell, but I can't figure out how to get the rest of the data in. I inserted pictures of an example array of data I am trying to use as well as the snippet of the code that I have to accomplish this task. Essentially, I am just looking to take this data, swap some of the columns and then write that data into an excel file that already has headers and formatting done. I hope this is making sense, but any help is appreciated! Thanks!

Data.PNG

snippet.PNG

FPGA and External Clock Source

$
0
0

Hello,

I am new to FPGA world and trying to use an external clock for NI PXIe-1073 that has a PXI-7851R IO. I tried to feed the clock signal using a digital input, but the digital input does not show up in the clock options of time loops in labview FPGA.

I would appreciate it if you could help me in this issue.

Thanks,

Masoud

User-defined sequence to control valves

$
0
0

Hi all - 

 

I'd like some direction in the best way to code a valve sequence structure in Labview 2011. I have six valves. On the front panel, I'd like the user to be able to program in events for a sequence. For each event, the user selects a valve, a start, and a stop time. It would look something like this:

 

Valve 1, 3 sec, 5 sec (this means the valve is open from second 3 to second 5)

Valve 2, 4 sec, 6 sec

Valve 1, 7 sec, 8 sec 

Valve 3, 1 sec, 2 sec 

 

As you can see, this allows there to be multiple events for each valve and the events do not have to be chosen in sequential order. After entering in as many events as the user likes, they click the go button. The sequence then plays through and opens up the valves for the times requested. 

 

Could you please point me in the right direction for how to code this? A link to a tutorial or example would be a helpful starting point. I've read through a few forum posts about similar things, and my initial thought is to use a state machine. I read through the tutorial on that, and I understand the concept. But I can't figure out how to apply it to my specific objective. In the state machine, is every event it's own case? 

 

Any tips are appreciated. Thank you very much!

 

 

Problems calling dll or loading .net assembly - microchip MCP2210 with labview 2016 x64

Wrting to lvm file and reading it in same loop

$
0
0

Hi

I am writing lvm file (10 samples in one loop at 1kHz) inside a while loop and displaying it. 

The same data i wanted to read and display.

But the issue is that read vi reads first 10 samples in every iteration.

My objective is to synch the two charts and display same data in every iterations .

Thanks

conflict resolution Labview myRIO-2016

$
0
0

I am using a project (see zip file) wrote using LabVIEW myRIO-2015 for the IMU sensor MPU9250. The computer that I am using has LabVIEW myRIO-2016 installed. It also has FPGA, Real time modules and drivers.


When I run the FPGA program (FPGA_MPU_rev1), it compiles properly and works fine.. But when I run the real time program (RT_MPU9250_main_rev1), I am asked to save the changes (figure1). After I choose save, the program runs fine for 128 iterations and then I loose the connection to the myRIO target (figure2). I choose Ok and run the program again. I get the conflict resolution error (figure 3 and 4). After I choose Apply, the program runs for 128 iteration and looses the connection again.

 

I used a different myRIO to check if its the hardware issue. But I still have the above mentioned errors. I even tried repairing the RT module using NI-MAX, but it did not help.

The program seems to work with a different laptop which uses LabVIEW myRIO-2015 software.
Can anyone explain what is wrong here?


mohon bantuan , menampilkan perbedaan sinyal suara

$
0
0

izin bertanya kak,, bagaimana cara menampilkan perbedaan sinyal suara kita dengan orang lain dan juga memakai FFT . disini saya menggunakan input suaranya yaitu sensor suara dan memakai interfacenya arduino.. mohon bantuannya terimakasih 

Synchronize two USRPs without cable

$
0
0

I want to use one USRP to transmit messages to the other USRP without cable.

However, I have no idea to do the clock synchronization of USRP, so the received messages are wrong.

Can every one who knows that give me some advice?

 

Thank you

"Combine" several HALs into one HAL implementation

$
0
0

Dear NI Community,

let me, please, ask you about the following.

 

I have two HAL classes, which represent DMM and Switch devices. They have methods like Read configuration, Init, Deinit, specific configuration, do some actions (depends on the device, DMM or Switch). These classes are separated, as two different HALs, libraries.

 

Now, I have device which is Multifunctional Switch/Measure Unit - it has slots, where one can put switch modules, matrix modules, relays modules, etc.; and it has internal DMM which allows to measure current, voltage, resistance, etc.


I can communicate with device, let's say, by VISA. There are drivers for the device, via which I can control it.


And I'm just thinking - can I combine my two HALs for DMM and Switch to one HAL Switch/Measure Unit? B/c indeed, it includes those two devices. But the problem is, that DMM and Switch units are implemented in a way, that they obtain VISA (or some other) reference for communication with device in method Init, and then keep that reference in private data.
With this approach, I can't two times init my Switch/Measure Unit, b/c it's simple COM port, and I'll have error during opening it the second time.


The solutin could be, to create some abstract class/interface, which will allow to pass into DMM HAL and Switch HAL opened reference to the device. And then, my Switch/Measure HAL will have method open reference to device, and pass it to DMM HAL and Switch HAL.
But, this will break DMM HAL and Switch HAL, because as stand-alone devices they don't need this method at all.

 

Are there some common approaches to this task? Some examples of how to combine several HALs to one, when they indeed share some resource, which is private in their implementation? I've heard about MAL example from Elijah Kerry, but I'm not sure whether this is what I need... Are there some examples for this task?

 

Or I am doing something wrong, and my HALs are not properly designed then; and I don't need to keep reference to device in private data of HAL implementation, but it should be some abstraction, which will be contained in HAL definition?

 

Thank you very much in advance!

 

Sincerely, kosist90

 

logos_middle.jpg

 

JKI VI Tester – useful tool for LabVIEW developer

Simple Signal Simulation Loop

$
0
0

Hey there,

 

I'm trying to build a loop that will take a reading from a data acquisition device, show the reading on a chart within the loop, and after the loop is finished display the full results into a graph. Also, I'd like to create results of temperature with respect to time that I can write to an excel sheet once the loop is fully completed. The loop will be on for about 24 hours and takes a temperature reading every minute.

 

I'm just messing around with a simulated signal to try and get that working so far but I can't display my results into a graph at the end of a loop. Any suggestions on how I can do this?

 

Thanks in advance

New to LabView

$
0
0

Hello everyone. I am new to LabView and have no basics of electrical engineering. I have to create a VI where graphs of force/displacement and torque displacement will be displayed. Basically I have 2 LVDTs that will provide the position, 1 load cell and 1 torque cell. Do you think it's possible ? This will hopefully be used by doctors who will only need the graph and whitout any knowledge of LabView. Also the VI has to be universal that is, applicable to all patients.

Thanks in advance and Im so sorry if these are dumb questions

Viewing all 68962 articles
Browse latest View live


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