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

DLL returns pointer to void typedef, how to handle that with Call Library Function Node

$
0
0

Hello,

 

Let me preface this question with: yes, I have seen the hundreds of post out there about this but I cannot seem to solve the issue.

 

I have a third party C++ DLL with a function that returns a pointer to a void typedef:

 

typedef void *  HANDLE_NAME;

I do not want to access the contents of that typedef just pass it to other functions in the DLL.

 

What is the proper method of configuring LabVIEW's Call Library Function Node (CLFN) to allow this pointer to be passed through LabVIEW? I have tried making the return data type of the CLFN to be unsigned/sign integers and pointer sized integers but LabVIEW always just returns error 1097 when I try to pass this point back into a DLL function. I've also tried passing by value and by pointer.


Call by Reference Runs in UI thread

$
0
0

Hi,

I'm having a hard time with the code below being executed in the UI thread.

UIThread.png

I've read the following article:

https://www.winemantech.com/blog/the-ui-thread-root-loop-and-labview-what-you-need-to-know/

 

It suggests that using the Call by Reference should enable me to run in any thread, but it also mentions that if I use a type specifier the code will run in the UI thread.

 

Any help on how I could convert the following code to code that can dynamically run a VI in any thread would be greatly appreciated!

 

Thanks,

Maciej

 

RS232 communication with myRIO through the pins

$
0
0

Hi, I've been trying to communicate with the myRIO using this board to no avail, I have  discovered only recently that myRIO doesn't support RS232 comm without the UART rapper.

 

I'm wondering if there are any other configuration I could try to set up the communication since I'm only interested in receiving from this one device with out transmitting anything.

 

I found a discussion in the forum where a someone suggests the following :-

tannerite  N/A
‎07-15-2014 01:02 PM

One thing I think worth mentioning is that there are UART TX and RX lines on the MXP connectors that can be used to interface with a serial transceiver. They cannot use "2-wire DTR controller" or "2-wire DTR controlled with echo" modes because the DTR lines do not exist on myRIO; however, you can use 4-wire or 2-wire auto modes depending on how you configure the transceiver.
 
I believe you can do multi-drop with 4-wire mode, but you cannot do multi-point. Multi-drop means multiple receivers while multi-point means there can be multiple transeivers and receivers. When in 4-wire mode, there are separate pairs for TX and RX, you can do multiple receivers but only one transmitter.
 
The UART TX and RX lines on myRIO were designed to be connected to a serial transceiver, whether it be RS-232 or RS-485. I hope this helps.
Tannerite
National Instruments

I'm wondering if what he's suggesting is relevant to my issue, and would love some extra details.

 

Thank you.

 

Long en double

$
0
0

Bonjour,

Je souhaiterai convertir une chaine long en double pour pouvoir utiliser la fonction écrire dans un fichier tableur (en fait je récupère des long que j'aimerai écrire dans mon fichier tableur), comment je peux faire pour que le format soit compatible ?

merci pour vos réponses

Virtex 7 fpga vc707 with Labview 2014

$
0
0

Hi,

Is it possible to used virtex 7 fpga vc707 board with Labview 2014?

 

Thank in advance

Problems with loop time and DAQmx when designing a P-regulator

$
0
0

Hello!

 

I've attached a VI I'm currently working on. The aim is to create a functionable P-regulator which will compensate my original sweep signal so that the output will look like the sweep. The sweep is the setpoint and I'm tryng to compare each datapoint in the sweep with each datapoint from the output to get my error. The problem is that I don't manage to make it work, and it seems like the loop time is way to slow. Every sweep should be 50k samples with a sample rate of 5000Hz. 

 

I belive the program picks each datapoint from the array with the sweep as it should right now, but not really sure how to manage that with the output signal from the DAQmx blocks. Also uncertain if it is possible to read one sample at a time at this rate with the DAQ. 

 

I'd appreciate comments and pointers on the problem at hand, and on the code in general.

Im pretty new to Labview so im sure there are lots of things that could be done better and more efficiently. 

 

Best regards,

 

Oscar

Error Log File location after LabVIEW Crash running executable on non-development PC

$
0
0

Where Is the Error Log File Saved after a LabVIEW Crash when running an executable on a non-development PC?

Mit myRio Videos machen

$
0
0

Hallo,

ich hab das myRio Modul 1900 und weis das es AVI. nicht unterstützt würde aber trotzdem gerne ein Video aufnehmen und speichern.

Bin für jede Hilfe dankbar .

 

 


Programmatically defineing which DMA FIFO to be accessed in Real Time

$
0
0

Hi all,

 

I am trying to write a generic DMA FIFO polling vi that uses a reference to select the appropriate DMA FIFO object to read. Normally I would generate a reference to an object and select the method from the drop down menu. I can create a FPGA reference constant that contains only the reference to the FIFO I want. But when I wire this to an FPGA invoke node the node requires specific configuration; it isn't generic like typical invoke nodes which operate on classes of objects.

 

Does anyone know how I can programmatically define which DMA FIFO a FPGA invoke node reads from?

 

Thanks!

Starting a timer based off voltage difference

$
0
0

Hello!

 

I am very new to LabView and I am struggling to get started on a project. My project is to build a ramp and run a car down the ramp. While the car goes down the ramp I will have lasers and photo resistors to measure the car's time stamps. From there I will get velocity, acceleration, and position. 

 

The problem is I have yet to find a LabView function that will start recording the time the moment my first photo resistor's resistance drops due to the car blocking the laser. 

 

Someone in person recommended Elapse Time in Express Via, but I am trying to collect as much information as I can on the subject. I am open to different approaches to this problem if anyone has a different method. 

 

Thank you

Simulate USB-6008 counter

$
0
0

Hi,

   I am trying to simulate an edge counter using the Simulated USB-6008 in LabVIEW. In MAX16 I can configure a task "CountEdges" that uses the physical channel DAQ1/ctr0, with PFI0 as the input channel, all on the simulated USB-6008. But unlike the analog input channels, I also have configured in a different task, with return values (a sine wave), I get only a 0 (zero) when I run the task in MAX or LabVIEW. Am I doing something wrong, missing something, or does the simulation not provide anything other that zero?

 

Usually I have hardware to try my code against, this time ...

 

Thanks,

Increment Value On button Click

$
0
0

Hi all,

Can you help me?I want to increment one value whenever the Ok Button is clicked.On the same time i want to generate a random table with values when click on this Button.I want to increment values before Stop button is clicked, but now, all i have is a button Ok which increment one value and a button Stop who generate table.

Thanks in advice.

Zero values with simultaneous DaqMx

$
0
0

Hello,

 

I am experiencing a small issue with using two DaqMx in parallel.

 

I have one loop repeating with a 100 ms delay that records DAQ information from multiple pressure traducers and low meters.  We are using one flow meter that outputs current, not voltage.  This required two different DAQ acquisitions.  We write the dynamic data to a text file once per loop.  Despite a 100 ms delay, recording at 1000 or greater Hz is possible.  To me this tells me that the dynamic data type stores data over time in a matrix and can upload an array of different time stamps to a file at once.

 

My problem comes from combining the two DAQ channels (voltage has about 5 inputs and current has only 1).  For a 1000Hz frequency, we are getting a zero dataset every .401 ms (or potentially .400 if this data point does not accurately represent that one ms of data and it should not be there).

 

Time

PT 1

(Voltage)

PT 2

(Voltage)

PT 3

(Voltage)

FM1 (Current)***** (Voltage)
0.2981047.753427.9070.7820.1340.014
0.2991047.669427.9090.7870.1260.013
0.30000.0960
0.3011047.689427.9270.8130.0820.013
0.3021047.737427.8960.8250.0710.013

 

This also happens the other way where I get zero values for the current device but populated values for the rest.  For this case they happen at 0.301 second intervals (or 0.30).

 

TimePT 1 (Voltage)PT 2 (Voltage)PT 3 (Voltage)FM 1 (Current)

FM 2

(Voltage)

0.0981047.501427.7970.9810.1070.013
0.0991047.677427.7881.0050.1150.013
0.11047.793427.7840.99200.012
0.1011047.809427.7871.0310.1190.012
0.1021047.857427.7650.9980.1130.012

 

How can I make these two communicate properly and prevent these 0 datapoints?

 

I am using labview 2015 and the following Daq code:

Untitled3.png

 

 

Clearing DAQmx AO task takes long time

$
0
0

Hi,

 

I have an application that has been running on 2 PXI machines and another machine with NI USB 4431 for over a year now. Recently, I upgraded the 2 PXI machines with 64-bit cards(PXIe 8840). After upgrading, one PXI machine started taking a long time to clear the Analog Output task. I have attached the acquisition code here.

The same code runs fine on the other PXI machine. Both the machines have Win 7-64 bit, 8 GB of RAM, latest version of DAQmx. The same code also runs fine on the machine with NI USB 4431.

 

I swapped the 8840 cards in the 2 pxi machines and still the PXI machine 1 would have the same issue.

 

Going through the forum posts, it seems like updating the daqmx driver would solve the issue but it didn't in my case. 

Does anyone know what could be the issue and how to resolve it?

 

Thanks,

Ritesh

Waveform Chart - Plot every n Samples

$
0
0

Hello, all, I have a question that has been bugging me for days. I'm running a main VI that records an "hour:" ever twelve iterations of the while loop. This probably isn't the most efficient way to do this, but that's not what I'm trying to change. I'm tracking another variable (energy) that I want to plot against "hours". My question is, how can I use the waveform chart to plot the value of "energy" every "hour", i.e. every twelve iterations?

 

I'm not using a real-time-stamp, though. This is pure simulation, it doesn't necessarily have to model actual time.


why cant tone measurements measure frequency below 10 Hz?

$
0
0

I'm using tone measurements to measure frequency, but when the frequency below 10 Hz, the tone measurements give wrong output, it wont fall below 10 Hz

The frequency range i'm working on is between 0-100 Hz

Thank you

Ethernet Joystick

$
0
0

Hello,

i want to read some joysticks parameters by an ethernet connection. As I did not find any joystick with ethernet I am thinking of connecting a USB joystick with an Ethernet/USB printserver like this one:

 

https://www.amazon.com/StarTech-com-100Mbps-Ethernet-Network-PM1115U2/dp/B016A4MSA4/ref=sr_1_2?ie=UTF8&qid=1493271288&sr=8-2&keywords=usb+ethernet+adapter+server

 

It has a static IP so I could connect it with LabView. I just wonder whether it will be possible to read out the joysticks parameters if it is connected via that printserver. Does anyone have any experience on that?

Launchpad in LabVIEW.

$
0
0

Dear LabVIEW friends,

In this VI you will find my final program for a basic Launchpad for all you people who whish to make this themself. I've got one goal next: it are RGB leds and i'm currently only sending the green ones out on the button i click but as you can see from the front panel i programmed it to give a blue & a red led also. Can sombody with knowledge send me the solution if possible i don't really have a clue how i should do it because the leds that needs to go Blue/Red are not the ones from the button i click.

I'll put some pictures of the project and the links from the products i used for you guys!

Good luck for the ones who wish to make the same thing.
And thank you for the ones helping me with the solution.

Button pad breakout:
https://www.sparkfun.com/products/8033
RGB leds:
https://www.sparkfun.com/products/105
Buttons and pad:

https://www.sparkfun.com/products/7835
NI USB-6501 24-line Digital I/O

Integration of waveform signal within a consumer loop using current data element and previous data element

$
0
0

Hello,

 

I'm using 6 accelerometers connected to a cDAQ-9174 with NI 9215 modules to calculate angular accelerations of a rigid body in accordance with algorithms in literature.

 

I require angular velocities therefore wish to integrate the angular acceleration waveform signals iteratively within my consumer loop. I need the integral to use the current data element and the previous data element of the acceleration waveform.

 

I'm currently using the integral block with the initial condition set to zero and the data component of the angular acceleration waveform connected to the X. Would this be functioning the way I want it to as stated above?

 

Please find my code attached below. The integral is located within my consumer loop with wz as its output.

 

Thank you Smiley Happy

Array Selection Color

$
0
0

Hello, I am wondering if it is possible to change the color of the array selection propriety. I have been looking for all the proprieties and i searched in the forum but didn't find a solution yet.

Attached is an example of what I mean for array selection, I guess you know what I mean..

Thank you in advance!

Viewing all 67081 articles
Browse latest View live


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