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

Timestamp of dynamic data type

$
0
0

Given the following simple data-acquisition program.

simple_daq.pngProblem

I understand that the while loop will iterate close to 10 Hz, where f_loop = f_sample/N_samples_per_channel. Every second, the DAQ captures 100 samples for each channel (6 channels in my case), and the buffer size is set to 10 samples/channel, so the computer has to read or empty the buffer 10 times per second to keep pace with the DAQ. I also understand that the while loop won't operate exactly at 10 Hz because I'm running this over Windows. However, I don't understand how the resulting data file has relative timestamps for every single datapoint (first col in picture below). 

datafile.PNG

Does W2M simply use the dt value in the dynamic data type variable to linearly interpolate the relative timestamp of each sample using the timestamp of each loop-iteration? If not, what's going on?

 

I ask because I'm trying to program an equivalent program in Python using NIDAQmx, and I'm not sure how to tack-on the time for each sample in my data arrays. Thanks! 


UDP Read does not receive data

$
0
0

I am using LV2016 to send and receive UDP data to an embedded controller (TI Delfino DSC).  I am able to receive the UDP data from LV on the DSC.  The UDP Read times out without receiving any data.  I am using modified versions of the Simple UDP example.  I added the IP address of the USB network adapter that I am using to both UDP Opens, and adjusted port numbers. I have disabled the Firewall, and virus checker.  I am using PC Write Port 1121, PC Read Port 1122, DSC Write Port 1124, DSC Read Port 1123.

 

I am running Wireshark to monitor the data packets.  Both Send & Receive data packets look good on Wireshark.

 

UDP Write Datagram viewed on Wireshark:

Frame 5: 50 bytes on wire (400 bits), 50 bytes captured (400 bits) on interface 0

Ethernet II, Src: Siig_60:40:7d (00:00:ba:60:40:7d), Dst: 06:e5:96:c0:1e:00 (06:e5:96:c0:1e:00)

Internet Protocol Version 4, Src: 10.10.10.1, Dst: 10.10.10.2

User Datagram Protocol, Src Port: 1121, Dst Port: 1123

    Source Port: 1121

    Destination Port: 1123

    Length: 16

    Checksum: 0x2838 [unverified]

    [Checksum Status: Unverified]

    [Stream index: 1]

Data (8 bytes)

    Data: 5231323334353640

    [Length: 8]

 

UDP Read Datagram viewed on Wireshark:

Frame 6: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: 06:e5:96:c0:1e:00 (06:e5:96:c0:1e:00), Dst: Siig_60:40:7d (00:00:ba:60:40:7d)
Internet Protocol Version 4, Src: 10.10.10.2, Dst: 10.10.10.1
User Datagram Protocol, Src Port: 1124, Dst Port: 1122
Source Port: 1124
Destination Port: 1122
Length: 16
[Checksum: [missing]]
[Checksum Status: Not present]
[Stream index: 2]
Data (8 bytes)
Data: 3132333435363738
[Length: 8]

 

The UDP Read Datagram shows Checksum as missing, but I have read on this Forum that UDP works with Checksum of 0000.

 

I have 10 bytes of padding on the datagram sent from the DSC.  I have tried adjusting the IP header length, did not work.

 

I have run netstat -an and I see my ports: 

UDP 10.10.10.1:1121 *:*
UDP 10.10.10.1:1122 *:*

 

Send.pngReceive.png

 

Is there any documentation/explanation I could read on the CompactRio NI 9237 C series module example code?

$
0
0

NI 9237 FRONT PANEL PICTURE.png

So I'm very new to LabView and struggling to understand the example code for the C Series NI 9237. I've set up my load cell, module, and the LabView Getting Started NI 9237 example code. So far everything is working and I can see an input from my load cell. 

 

However I was wondering if there was an documentation I could read on this example program about the parameters on the FrontPanel. I don't fully understand many of the input parameters (For example Poisson's Ratio) and the meaning/effect it will have on my data. My load cell spec sheet doesn't specify a lot of the parameters besides Bridge resistance. 

 

I also don't understand the graphed output either, and why I have essentially four data lines and the FPGA error out. 

 

The example code can be found under the NI 9237 example finder

>>Hardware input and output >>compactrio>>Module SpecificIO>> Analog Input>>NI 9237

 

Thank you!

How to modify existing example code for CompactRio NI 9237 to write data to file?

$
0
0

So right now I'm using the CompactRio NI 9237 example Getting Started code for reading a load cell. However the example code only gives me a snapshot of my current force values and does not give me a continuous data log of the values. I'd like to store the files in something easy to read like an excel file for example or notepad.

 

 

The example code is pretty complicated and I'm a complete beginner to LabView and CompactRio so any help with modifying the code would be great. I'm not sure either what file type is best to store the data.

 

The example code can be found under the LabView example finder

>>Hardware input and output >>compactrio>>Module SpecificIO>> Analog Input>>NI 9237

 

Thank you.

application builder missing files

$
0
0

Hello,

 

I suspect this is an easy fix.

I am trying to build an appliation I built on my old PC on my new PC.

I am given a message saying I am missing these programs in my additional installers:

 

ActiveX Container Support

Real-Time Utility Support

Visual C++ 2008 (and 2010) Redistributable

Visual C++ 2008 Runtime

Mesa Graphics Support

NI-VISA Configuration Support 16.0

 

When I did a search for some of these, I couldn't find them.
Is there a driver package for LabVIEW that I need to install to add these? I installed LabVIEW using a program download, not a CD.

 

Any pointers are welcome. Thanks.

Labview for a small community Microgrid smiluation

$
0
0

Hello all;

I would really appreciate your help and guidance.

I am a Control Engineer, doing my Master's Thesis on the Control of Microgrids (On a Scada/DCS Level). 

I have never used Labview before; However, I have a good experience in Control and Programming.

 

My aim is to model a Microgrid for a small residential community in the UK, without using any hardware, to simulate the interaction between the loads and renewable energy generation, and perform some cost/power optimization analysis.  I am also intending to include a Main Grid connection in my simulation.

The system that I am aiming to simulate would consist of a small Solar Farm, Battery storage, and a diesel generator; pretty much similar to the following case study:

http://sine.ni.com/cs/app/doc/p/id/cs-16647#prettyPhoto

 

I have read the previous discussions regarding that topic and found some advice on using Multisim in conjuction with Labview; However, I would rather only use labview if that is possible.

 

My questions are:

1-Is it technically feasible  to complete such a scope of work (Modelling + Simulation) using Labview only without adding any hardware? or do I have to use Multisim or simulink to simulate any parts of the system?

2-Are there any Labview "Renewable Energy"/"Micro Grid Parts" templates, or do I have to build everything from scratch?

3-What would be the main steps for creating that scale of work?  Should I, for example, create a VI for each section of the Microgrid, and a main VI to manage them all together?
4-Could anyone guide me to an example of a similar functioning project so I can use it as a reference ?  It doesn't have to be related to Microgrids; just any similar project can be a good refrence.

My time frame for completing that work is three weeks maximum, but I am fully dedicated for it.

I really appreciate your help.

Kind Regards;

Mahmoud

NI I/O Trace serial port data format

$
0
0

I captured serial port data from LabView with I/O Trace. However, the data is in ASCII format. Is it possible to capture the data in hex? below is an example of my data.

thanks

 

2417.  VISA Write ("COM14", "ÀP.À")
Process ID: 0x0000146C         Thread ID: 0x0000080C
Start Time: 13:31:53.095       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

2418.  VISA Get Attribute ("COM14", 0x3FFF00AC, 6)
Process ID: 0x0000146C         Thread ID: 0x000014B0
Start Time: 13:31:53.345       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

2419.  VISA Read ("COM14", 6, "À....À")
Process ID: 0x0000146C         Thread ID: 0x000014B0
Start Time: 13:31:53.345       Call Duration 00:00:00.000
Status: 0x3FFF0006 (VI_SUCCESS_MAX_CNT)

error 100 building installer in labview 2015

$
0
0

 

The exe can build successful,but the installer build failed.

 

Error details:

Click the link below to visit the Application Builder support page. Use the following information as a reference:

Error -1 occurred at CDK_Utility_GenerateErrorCluster.vi -> IB_MSI.lvclass:Build.vi

This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.

Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-1) or for its hexadecimal representation (0xFFFFFFFF).

The following errors and warnings were recorded during the build:

Error:
*** Abort requested.
Details:
 
Done building deployment
Code:
-100

 

无标题.png


some questions about Event Struture

$
0
0

Please see Test1.vi,when i click on the button 'OK',the value of 'display1' is the same as 'source',but the value of 'display2' is the 'source' i enterd last time.For example,if i enter 1 and 2 into 'source' before and after for two times,when i click 'OK' the second time,'display1' is 2 but 'display2' is 1.

 

I want to know why this happen.Thanks!!

Obtaining data from queue and writing to file

$
0
0

Hello,

 

I am having some trouble reliably obtaining data from multiple queues. I have three instruments connected via usb that I am polling at 129Hz each. I am enqueuing the responses from each instrument into their own queue and then dequeuing all three to combine them into one data packet.

 

I have two major issues with my code:

 

1) Only 2 of my queues seem to get combined into my final data packet. As far as I can tell, the dequeuing logic is identical so I can't understand what's going on.

 

2) Sometimes I obtain partial results, with much of the data missing.

 

The following two links are samples of what the data output looks like illustrating the two issues i'm facing;

 

https://pastebin.com/eNXxWAN1 (This looks ok, but is missing the data from the third queue)

 

https://pastebin.com/snZG4smB (This contains one partial dataset, one full, and still missing data from the third)

 

I have included a 'tag' in the data indicating which queue it comes from (01P2, 02P2, 03P2), and it shows that it is not one queue in particular that gets missed out.

 

I observe the same behaviour when I reduce the frequency down to 33Hz, and looking at Resource Monitor whilst my code runs convinces me that 'speed' is not the issue here.

 

Can anybody help me figure out what has gone wrong?

 

I have included the two vi's responsible for generating and recording the data. Sorry for the long post, but I think there's quite a lot of relevant information.

 

Thank you!

 

 

 

clear labview memory

$
0
0

While running the project its size is around 700-900 mb but after 30 mins it decreases to 200 mb. Usually the size increased in due time but here it reduces and i don't know the reason , Why the project is consuming more memory (700MB) for the first 30 mins.I need the project memory to be maintained 200MB from the beginning itself.

I have cleared all the references, clear indicators when called and used request deallocation function in needed SUBVIs .

 

 

C# Async based dll in LabVIEW

$
0
0

Target Client - LabVIEW 2014

 

Hi,

 

I have created a DLL of TAP() in C#. I wish to consume my async functions in LabVIEW, is it possible? If yes how?

 

My function looks like :-

Snippet

public async Task<bool> AttachCOMPortAsync(string portName)
{
// Do something
}

 

Making LabVIEW multi-threaded, for independent parallel processes, connected by queues

$
0
0

Good day,

I am working with a complex LV program, in which data-acquisition is done using DMA buffers (because data rate is high, 2.2GB/s. DAQ is done using subVIs that came with the DAQboard (AlazarTech)), and some of the data is copied to LV (1 in N) into a lossy queue, on which some processing had to be done and finally displaying. (also some AO signal are created and send out using NI board, but let's forget about that for now.)
The problem I am having is that when I do some processing and displaying buffer overflow of the DMA buffers starts occuring. If I disable the processing and displaying, but still copy some of the data to LV I can avoid buffer overflow by only copying 1 in 15 buffers to LV. (buffersize is 6MB, which according to Alazar is in the referred range 1-8MB). Of course the copying to LV takes some time, so during that time the buffer being copied has to stay on the DMA buffer, and therefore the other DMA buffers will start filling up, until the copying is done and the buffer can be released. If I now do some processing on the buffer in LV I did not expect that to influence the DMA buffer behavior, especially since I'm using a lossy queue in LV.
After quite some discussion with AlazarTech, I finally understand that since LV is governing the DMA buffers (though ATS Api) it can slow this down if it is too busy with other things, such as processing and displaying.
Therefore I would like to make my program multi-threaded so that the governing of DMA buffers, and copying 1 in N to LV is separate from the processing and displaying.
In general I read that LV should make things multi-threaded itself, e.g. if you have two separate while loops. One question I have regarding this is, If I have nested loops, they probably cannot be on different threads, correct? (Of course I've avoided nested loops by now, but I'm curious, e.g. can 2 while loops inside another while loop or inside a case structure be on different threads?)
I've also read about the subVI priorities. I've set the governance of the DMA buffers to highest priority, and I've made a processing subVI which I set to low priority. I have also put the preferred execution systems to different ones for the DMA buffers and the processing, hoping that would make them multi-threaded. I have turned off debugging in the execution tab for the DMA and processing subVI, because I read that that would be a good choice if you want something multi-threaded. And in the processing I have put some multi-channel FFT subvi's I have on preallocated clone reentrant execution, so that they have their own memory space and don't have to wait for eachother (there are only 2). For the DMA buffers I've used non-reentrant execution, because the order of execution is very important here.
To come to my question, which might not be the correct question to ask, maybe from my story you can guide me in a different direction:

Can I make labview run different parts of code on different threads, and would that help me in solving them influencing each other?
Perhaps the problem is that the threads have to communicate through the queues and that makes them somehow dependent?

I hope someone can give me something new to look at.
Thank you very much in advance!
Best Regards,

Judith

Error 20023

$
0
0

Hello
I face the probelm error 20023 and I try to use "Build Waveform function" to add the time for filter but the wire of waveform still fail. Now I dont know how to fix it.

Could anyone please help me solve it ? 
VI is attached

Thank you in advance.

Nachatcharin

Determine RFID Tag Distance

$
0
0

Hello guys,

 

As hinted in the title, i am implementing my own RFID system for automatic inventory control. The reader i have does not return a RSSI index, so i cannot compute distance to tag based on this. I figured i can get that distance by computing the time it takes for the radio wave to reach the tag and back. I have attached a part of my code that writes and reads to a serial port using VISA vis. I would like to know if there is a way to get the time when labview actually starts writing to the port, and when it starts reading back the response?

Is this remotely possible?

 

Thank you,

Fadi 


How to modify fpga personality ?

$
0
0

hi

i want to modify the default fpga personality to only control PWMpins

and leave the  remaining pins to RT to control them or do what i ever  want to do with them

 

when i first tried to control a servo using fpga and read anlog sensor from real time , the fpga only worked when i removed the fpga , the RT worked!

i found this solution in https://forums.ni.com/t5/Academic-Hardware-Products-ELVIS/Using-more-than-4-quadrature-encoder-input-for-MyRIO/m-p/2776962

that says i need to modify the default fpga personality add and remove components as needed and then build the bitfile.

i removed all DIO pins from connector A and connector B except the PWM functions (see the attached file)

i built the bitfile then updated the Open FPGA VI Reference in myRIO v1.1 Open.vi like the solution said

original.png

i also updated Open FPGA VI Reference  in my RT vi block diagram

original2.png

after all that i didn't work  Smiley Mad

 

 

my questions are as follows

 

  1. how to properly modify the default fpga personality? with steps please!
  2. where to put my pwm fpga code ? as i don't know where to put the pwm fpga code and iam very confused
  3. if someone  could modify fpga personality to only control pwm pins and create an example on RT, i would really appreciate any help

 

Thanks,

 

labview 2016 to 2015

$
0
0
Moved to another board Note that there is a board dedicated for Version Conversion requests so that they don't clutter the regular LabVIEW board.

VI Scripting error 1060

$
0
0

Hi all,

I have a question when I am learning the "Script Random Strip Chart" example of VI Scripting. To put the Waveform Chart inside the While Loop, the example uses the method of repositioning block diagram objects. I am wondering if I could directly wire the refnum output of While Loop to the refnum input of Waveform Chart. So I tried, but got an error 1060: " Object cannot contain (own) the specified object".

I tried to put Add Function or Numerical Constant inside the While Loop using this method, and they work fine. Why is Waveform Chart different?

 

Thanks!


 

General purpose error logger in highly parallel application?

$
0
0

Hi all,

 

I'd like to create a general purpose error logger the functions much like syslog() in the C/Linux world. Here's what I'd like for it to have:

 

1. Error Source (enum) - Provide some context to where the error occurred

2. Error Message (string) - User provided string to append to the message

3. Error Cluster Code (int) - self explanatory

4. Error Cluster Message (string) - self explanatory

5. Log Level (enum) - sets severity of the error, allows you to filter for critical errors/set compile time flags to ignore, for example, LOG_DEBUG errors.

6. Rate Limit (int) - Represents the number of milliseconds between appends for a particular message. Only works in reentrant versions of the logger.

 

I was initially thinking of using an action engine, but being nonreentrant, this would become a bottleneck in my application.

 

Then I thought of making a queued message handler, which would be nice from the perspective of fire-and-forget, but to prevent everyone from needing a handle to this queue in their private data, I'd need to make the queue named, or a global variable of some sort.

 

Another option is to make the action engine reentrant, and simply store the log path in a configuration file which all the clones could access before appending. This would be a little heavier on disk I/O, but given that I'm writing an error logger in the first place, that's not really a concern.

 

There could also be a hybrid QMH/action engine, where the AE simply stores the queue reference and a separate consumer actually processes them.

 

What do you all think?

Draw lines on top of multiple XY plot

$
0
0

I would like to look for suggestion or solutions to the following problem. I am currently using LabVIEW 2015 with the Control Design and Simulation module. Currently I am able to generate multiple XY data and plot them on a buffer XY graph in a simulation loop. Is it possible to draw a square similar to image below on top of the regular XY plot? The square should connect the points from each plot say at every t interval of simulation time.

 

An example would be, the simulation loop will generate the circle at run time. At the same time, at every 5s of simulation time, a square is drawn to join the instantaneous point from each plot.

 

Thanks in advance Smiley Very Happy

Picture1.png

Viewing all 69357 articles
Browse latest View live


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