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

PID Potentiometer's Voltage Control

$
0
0

Hello dear Community,

I'm new to LabVIEW and I'm trying to implement a simple control and monitor algorithm using PID Advanced.vi. I'm using cRIO in Scan Interface mode (1mS scan period) with AI (NI 9205) and AO (NI 9265) modules.
My input signal is a square wave 0-1V, DC:50%, 10Hz - AI ch.0.
AO ch.0 connected to 500ohm potentiometer, AI ch.1 connected to potentiometer too.
The purpose is to get the same output signal upon the potentiometer as the input signal, while changing the resistance of the potentiometer (AI ch0 = ch1).
I've tuned the pid gains manually, the best I got is attached in scope screenshot (red - input, yellow - output). Oscillations increasing as potentiometer's resistance increases.

How can I improve my results? In the next phase I would like to get auto tuning of PID gains.


String Formating Date

$
0
0

I want to string format a timestamp to: fri, 4 may 2017 13:34:55 -0000
Well, that's really easy with the following instruction: %a, %d %B %Y %H:%M:%S -0000

 

But unfortunately I am using a Dutch OS and I get: vr, 4 mei 2017 13:34:55 -0000, which obviously is language specific. There are no language independent formatting codes listed in the manual. Doe anyone have a suggestion better than manually mapping these values?

Match Pattern not working as intended

$
0
0

Hello,

 

Simple thing I'm confused about. I'm using Match Pattern to try and find [ in the string "Time[s]" and it seems that it is not finding it. What's going on here? It can find every other character in the string but not [. 

DSM application does not open up on a different user of a PC

$
0
0

LabVIEW was installed on my PC and was working well. A new account for a new user on the PC was created. LabVIEW can still be accessed, however when I click on NI Distributed Manager 2016 in Program Files in the new user account, the application does not open up. However, I can see that it started but it doesnt pop up.

REM-11180 Bus Coupler help!

$
0
0

Hello everyone, this is my first post here!  I just got hired at my first company and I am using LabView to do some R&D for our brand new REM-11180.  I am new to the LabView environment and Bus Couplers in general.  Do any of you have advice on a simple LabView project I could write to test the functions of the REM-11180?  I am a little lost on where to start so any help would be very appreciated!  

Delay a PRBS signal.

$
0
0

Hello guys, I have the following problem, I want to generate a Pseudo random binary sequence(i'm using the MLS sequence waveform), however the period of my pulse is the same period of the loop of my VI,which is 200ms, and I want to make each pulse last a range of 8s. I can't increase the time of my loop, because I won't have a real-time view of my system (i have a VI to control a intrumentation plant). Does anyone know how to do something like that?
I'm using the USB-6009.
Ps.: I'm sorry, I'm new to LabVIEW
Ps 2.: Sorry for the bad English, I'm from Brazil.

Running average - that old chestnut!

$
0
0

Hi all. I have been searching the forum for examples of a boxcar average but can't find anything that suits.

Let's say I have a continuous stream of data coming in at the left and a wire to a waveform chart at the right. I haven't done a vi because it's that simple. I don't know how many data points there will be.

All I want is a black box to insert in the wire that will give me a running average of n points, probably around 5. I don't want the source or the indicator to be inside any loop.

Nearly all of the examples have either a number generator and display inside a loop, or a fixed length array of data points to work on. I just want the data stream coming in, averaged as it goes, and going out. I'm sure it can't be too difficult.

Thanks for any help.

Andy.

Create Database using LabVIEW

$
0
0

I need to create a database of list of 5-10 users containing the username, account number, mobile number, fingerprint. And verify whether the user is authorized or not based on the fingerprint.
How can I do this in LabVIEW or what steps should I follow to reach the output?
Suggestions Required!


Saving intensity plot with cursor using IMAQ

$
0
0

Hello,

 

I have an intensity plot image that I want to save with cursor (without losing image quality) and having some issues. Can anyone point me where I'm doing wrong? I tried using overlay function to redraw cursor line in IMAQ but the coordinate is not right and the image size becomes 3 times bigger.

 

Thanks in advance.

 

Capture.PNG

Serial Communication Problem

$
0
0

Hi,

I want to communicate with my device (a CARD) equipped with a serial port.

First i must Open a com with 300 Baud rate, send a command and verify the response.

Second: Sent a command

Third: Open a second com with a Baud rate 9600 in the same Port

Fourth: Use Visa READ, and i must read a chain of character that confirm that open session is OK.

The problem is I don’t receive any response when i use visa READ in the Fourth Step and Bytes at Port = 0.

The picture below:

Capture.PNG

Lectura de voltaje

LabVIEW: Memory is full error, using a gigE camera

$
0
0

Hi,

 

The LabVIEW Application I am working on uses a gigE camera to pull in an image. However, when I attempt to pull in an image I get the LabVIEW: Memory is full error. The application ran recently. I think what may be causing issues is that there was a power outage recently. I reset the camera settings to what they should be for the LabVIEW App to run successfully, but the program is still displaying the same error. I have confirmed that the camera is connected through the NI Max. Any help would be appreciated.

 

Thank you

Flatten Unflatten vs TypeCast - Speed Test

$
0
0

LV2013

 

As is my custom, I checked out two alternate ways of doing something, to see which was faster.

 

Objective: To convert a "Generic" U8 Enum to a "Specific" U8 Enum.

IOW, both are TYPEDEFed enums with 256 values.

One will remain generic, to be used in a generic transceiver method, the other will be specific, to be used in a specific application.

 

Directly connecting a generic control to a specific indicator will not work, as LV (properly) complains that they are not compatible.

 

Scheme 1 flattened the Enum into a string, then unflattened it as the specific type:

G2S Flatten.PNG

 

Scheme 2 does a typecast from general to specific:

G2S TypeCast.PNG

 

Both are in INLINE SUBROUTINE VIs, so call overhead should be ruled out.

 

My Timing mechanism is well tested, been used for 20 years.

 

I was surprised to find that the FLATTEN + UNFLATTEN scheme was faster.  Significantly.  (227 nSec vs. 393 nSec).

 

My question (strictly academically) is WHY?

 

My thought is that the TYPECAST simply reuses the space occupied by the incoming variable and re-declares it to be the new type. IOW, no time at all.

 

Whereas, the FLATTEN has to allocated space for a string, create a LENGTH word, then take the string and extract one byte and create a new variable.

 

Obviously I am mistaken, so WHY?  Is the optimizer really smart enough to figure out what I'm doing and bypass some of that?  If so, why not on the TYPECAST case?

 

The VIs are attached if you care to play with it.

 

 

programatically instancing SubVI inside of lvlibp

$
0
0

I have a project that utilizes a plugin architecture to load some VIs dynamically.  It does this through the use of a packed project library.

 

The plug-ins that get loaded are generated via VI scripting.  The plug-in makes a call to a SubVI.  I know how to create the SubVI through VI scripting by using the New VI Object node and wiring the path terminal to the VI I wish to instance...but now I need to make it point to the one that's inside the PPL, not the native one stored on the disk.

 

To be specific, the name of the VI is IP_wrapper and the name of the PPL is view_support_lib.lvlibp.  Picture opening up the block diagram...I can right-click and drop down IP_wrapper.vi, or I can right click and choose the lvlibp, then a new dialog opens up and I choose IP_wrapper from inside that PPL.  If I then hovered the mouse over each of these, one would show up as IP_wrapper.vi, the other would show up as view_support_lib.lvlibp:IP_wrapper.vi.

 

I know how to add IP_wrapper.vi to a block diagram via VI scripting, but what I am asking is, how do I add view_support_lib.lvlibp:IP_wrapper to a block diagram via VI scripting?

Agilent 34980A MUX 4 wire measurement

$
0
0

I'm trying to do a 4 wire resistance measurement on a single channel (3034) but the values are very different every time I run the code. Can't figure out what I'm doing wrong.

Capture.JPG

 

 


Access the timestamp value of an EPICS variable

$
0
0

We use EPICS clients/servers on cRIO platforms.  I would like to access the timestamp of when the EPICS variable was updated.  The timestamp is visible in the Distributed System Manager and we can access it from other consoles outside of the LV environment.  Getting the timestamp outside of LV is an "option" when reading the VAL or other fields.

Any suggestions? 

Strange LVOOP / Notifier problem

$
0
0

I have cluster with 4 elements - objects (first three class 2DO2DI2AL, the last one class DIAL). APPINIT loop creates NOTIFIER for every object in cluster and stores notifiers references inside objects private data. MAIN loop periodically change some data inside all objects and send values via Notifier. GUI loop gets data from notifiers and displays them.

MAIN loop behaves correctly. However GUI loop shows bad data.

I went through the code again and again and I'm not able to find whats wrong.... :-( 

 

Keep in mind that forking of cluster wire is only for getting Notifiers refs into GUI loop (no data of objects !!!). Data transfer via notifiers.

 

Thanks for any help...

How to use more than two condition in if statement inside the formula node?

$
0
0

I know how to use the if and if else in the formula node, but is there any way that I can check multiple cases inside if statement?

for instance: How to write the following syntax in the formula node?

if (u1==1) && (u2==1) && (u3==1) && (u4==1) 

 

Ameer

Best way to create a large project to test an LED Driver

$
0
0

Hello experts,
I have been at this for almost a year, part time. I've rewritten it several times from the ground up as I learned. Small samples are
It seems like this should be a standard large project for LabView, but I am having trouble tying it all together. I have been able to take the device examples from one of the manufacturers and collect data for a few days, which is great. Now, how can more be added? I'm hoping there is a thread or example stash with all the answers.

The scenario is an electrical test setup for LED drivers, with four or more pieces of test equipment (up to 21) that need to scan (take samples) at the same rate and time. The minimum is an AC source, two power meters, and a DC electronic load. All need to save data to a file. The data will be voltage, current, power, and power factor. There need to be 3 to 12 tests that will need to be configured for: AC voltage and frequency changes, timing on each test from 30 seconds to 15 days, and the fewest number of files that contain all the data. I don't have NI hardware, so that limits the express VI's too. Later stages may need a Oscope or power analyzer to catch transients on RMS load, a DC power source, and thermocouples.

The project can be broken down into more manageable chunks. Is there an example that covers basic LED driver testing? Would the Core 3 training cover it all?

*) The configuration could be different based on the sample, so I started with a case structure for that. Inside that are the controls and initialization for each device.
*) What seems like should be next is a producer-consumer loop, with the measurements in the producer loop, and screen and file updates in the consumer loop. I've heard clusters may be unstable for what I need.
*) At the exit of the consumer loop is the device close and error recovery.

1) Looking for information, I can find example of how to set up one device, but not how to tie each stage to several devices at once. Is it better to have all the inputs loose just inside the config case? Or should they all be in a yet another while loop to be sure they sample at the same rate and time? Device selection and scan rate need to be common to all user visible panels. The rest need to be individual for each device controls. Is just inside the config case right for these to?

2) With more devices, each control and input is on the front panel, making it crowded. Ideally, each manual control should have matching a front panel control. Adding tab control helps to organize, but are sub-panels the best way to clean up the users view? Is there a better way?

3) What is the best point to get data for an input queue? What is the best format for the data to be in the producer and consumer loops? Should all the data be converted to dynamic and merged, or is it better to build a 1d array from each device, then build a bigger array with all the data from all the devices? All into a 1d array, or a bundle for each device? Or should each device have its own queue, to better support parallel processing?

4) When the data gets to the producer loop, should it be combined into (or stay) in the same merged/array for similar devices, or everything split to the different devices? This seems to be where an action engine would be used. The consumer loop would take the data and

5)On the output to a file, all the data can be connected from the display to be converted to dynamic and merged into a Write To Measurement.VI tdms file. Should this VI be inside the consumer loop or just inside the config case structure?

I could post what I have now, but I am not filled with confidence on what i have.

 

Thanks in advance,

John

Does creating queue/enqueue/dequeue/release queue work inside an FGV

$
0
0

I intentionally left my computer at work in order to force myself into some pad+pencil planning, so I can't test this. But I'm dying to know.

 

Can I make an FGV where the enum selects cases like "create/obtain", "enqueue","dequeue", and "release queue" to have the FGV make things easier? The main thing I'm uncertain about is whether the queue reference would immediately become invalid after creation since an FGV stops after a single pass of the while loop. 

 

Aside from convenience, it also seems like an easy way to ensure the queue is created/released in a single place. However, I'm also wondering whether this is a bad idea since I'd lose the event-like characteristics of having a dequeue with no time out in a loop that will actually be utilizing the data. I don't know, I'd like to hear comments on this vs using an FGV only for storing the reference, create, release functions.

Viewing all 67078 articles
Browse latest View live


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