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

Matrix - sum of elements under/above main diagonal

$
0
0

I tried to add the elements from the main diagonal with this code ( replace < with = ) and it works...If I use < or > the code won't work and I saw that it depends which element from the index ( inside the second for ) I add .Can someone explain me why it depends which element I add ? Why are there 2 elements in the first place and not one element with the i,j coordinates ?

I want an answer for this solution,I'm not interested in other much simpler solutions.

How can I make THIS code easier ?


VIPM paid addons

$
0
0

Hey everyone,

 

I have a quick question regarding paid add ons to which I haven't found information anywhere. In particular i'm talking about the following add on:

http://sine.ni.com/nips/cds/view/p/lang/de/nid/213032

It is listed at a price of 90€ on this page but if i search in the VIPM i can just install the package and it seems to be free. Can someone explain me how this works?

 

Thanks!

How can I make the data acquisition time controllable through oscilloscope?

$
0
0

Hello all,

 

The program attached acquires the time signals continuously from Agilent DSO X 3024. The problem is I can not get the signals for larger time span and the maximum I am getting is 2e-5s. I was wondering how I can increase time range (or make the time span controllable).

 

Thanks. 

One signal front edge to front edge timing

$
0
0

I've been trying for a couple of days to create a program using one signal to detect front edges and the times between them. I would like the times to be added to an accumulated output on the user interface if the time is above 2 minutes and 30 seconds. If the time between edges is less than 2 minutes and 30 seconds then the time is not added to the accumulated value and the timer resets. Attached are 2  time accumulator VIs I've created, but neither are outputting values.

 

Only 1 sensor shining on a reflector is to be used to accomplish goal.

Starting point:

When sensors beam is broken (rising edge) by unit 1, a timer starts

Scenario 1:

When the 2 nd unit passes through and breaks the beam (2nd rising edge) and the time between units was

less than 2 minutes and 30 seconds then the timer resets and starts counting the time between the 2 nd

and 3 rd units. This process will continue to repeat for hundreds of units.

Scenario 2:

When the 2nd unit passes through and breaks the beam (2nd rising edge) and the time between units

was greater than 2 minutes and 30 seconds then the timer will start collecting the time and adding it to

an accumulated value until the 3rd unit passes through and then scenario 1 or 2 will occur again.

 

Example incorporating scenario 1 and scenario 2

Unit 1 passes. Unit 2 passes two minutes later. Result = no time is accumulated. Scenario 1

Unit 3 passes three minutes later. Result = cumulative time of thirty seconds. Scenario 2

Unit 4 passes four minutes later. Result = cumulative time of two minutes. Scenario 2

Unit 5 passes one minute later. Result = cumulative time of two minutes. Scenario 1

So on and so forth. This will occur for hundreds of units.

Packed Library

$
0
0

I tried to make my Report generation module as packed library, So I can change this module without disturbubing my Application Executable. I build the Packed library and Integrated with my Application. when I launch my Report generation module it tries to load the NI Word and Excel librarys from the packed library and return the following error.

 

Error Code 1148 Error Message:

To More Specific Class in ReportGenModule.lvlibp:NI_report.lvclass:New Report.vi->ReportGenModule.lvlibp:CreateReport.vi->ReportGenModule.lvlibpSmiley TonguerintReport_main.vi 

 

[Discussion] Alternative Method for "Preventing Code Execution in the First While Loop Iteration"

$
0
0

Hi there, 

 

(Please let me know if this post is duplicated)

 

I was looking for possible way to implement a While-Do loop from text programming language in LabVIEW, and I understand that the While Loop in LabVIEW is similar to a Do-While loop (Running the code in the loop first before checking the condition). 

 

Here's a simple scenario: 

I was to translate the following code in LabVIEW: 

 

 

while (x > 0) {
   // Loop Code goes here   x--; 
// Note: Bear in mind the above line is just for simple scenario.
// There are cases where code within the loop involves calculate x value }

 

While I already have an idea in how to implement this in LabVIEW, I came across a LabVIEW Help link (along with other forum posts with solution) that suggested using Case Structure inside a While Loop. 

http://zone.ni.com/reference/en-XX/help/371361N-01/lvhowto/preventing_code_execution/

Which means the code will be something like this: 

Old.png

Although it is not wrong, but I believe this can be inefficient especially when running lots of iterations and execution speed is a concern. The While Loop will always running the Case Structure for every iteration and may introduce some overhead. 

 

So as alternative, instead of placing the Case Structure inside a While Loop, how about placing the While Loop inside a Case Strcuture? 

New.png

With that you can run the Case Structure only once to check the condition first, before running the While Loop if the condition is true. 

 

After tried running both methods, it seems that the alternative method runs faster than the method described in the LabVIEW Help site. 

I've attached the code below so that you can give it a try. 

 

Should you have any comments or a much better alternative to implement a While-Do loop in LabVIEW, feel free to discuss and share with us. 

 

Thank you. 

 

Regards, 

Ong Ee Lim

Windows Remote Desktop Crashes VI

$
0
0

Hello everyone,

 

I have an unusual error which I cannot work out. I often use remote desktop to control the computer on which my LabVIEW VI is running. Sometimes this works fine, but on occasion using remote desktop causes the VI to crash.

 

Does anyone have any experience, kno whwy this is or how to solve/work around this issue.

 

I know it is deffinetly related to Windows Remote Desktop as I experimented for some time by not using it and then using it and repeating. So this is an intermitant issue, but deffinetly attributed to Windows Remote Desktop usage.

 

Cheers! 

DSC module limits

$
0
0

Hi everyone,

I am developing application, which allows communication between OPC server on PC1 and DSC module IO server client on PC2. Aret here some limitations? Like how is the maximum number of items, which I can read (absolutely or per time)?

 

Thanks you for your reply!


Appearance of typedef'd controls in different vi's

$
0
0

Hi everyone,

 

I'm using a typedef (non-strict) to keep my data types across different vi's up to date. It contains a cluster which, among some other types, contains a typedef'd (non-strict) enum.

 

For my user interface I wanted to change the appearance from the default 'modern' to 'silver' style. So I marked the individual controls and tried replacing them. It doesn't work with the enum control.

 

If I keep the enum in the cluster, the size changes a bit but it keeps the 'modern' style.

If I place the enum outside of the cluster, it changes to 'silver' but removes the connection to the typedef.

(I also can't replace the cluster without it deleting its content...)

 

I can't figure out how to change just the appearance. Any suggestions?

Maybe it's a problem with the typedef inside a typedef?

Indicators and Controls on my GUI application move out of alignment when run on chinese windows 10.

$
0
0

I have a data logging application wsritten on Labwied 2012 that has been used for calibration purposes for several years throughout the world, although in low numbers less than 10. I have had no problems with the GUI until recently when a distributor from Tiawan installed it on their Laptop running Chinese windows 10 at 1366 by 768 resolutions. On my GUI I have several arrays of numerical values that normally aligned, these became offset and staggered and not asthetic at all. I have run the same software on a UK Windows 10 machine at the same resolution without any issue has anybody any ideas?

How to detect the pressed mouse button inside a event structure if not only the mouse starts the event?

$
0
0

Hello,

 

if I run a event structure with "mouse button pressed" I am able to dected if the left or right mouse button was pressed (value "Schaltfläche" = 1 or 2).

 

2016-11-11_16h09_09.png

 

But now, I want to add a second event to start the event structure. In consequence the value "Schaltfläche" is not available any longer. Is there another way to still deteced which mouse button was pressed?

 

2016-11-11_16h12_27.png

 

Thanks a lot.

Michael

 

How to continuously read a global variable across a sequence?

$
0
0

Hi, I have a main vi that runs through a sequence, containing various pauses and graphics handling. One frame opens another sensor reading.vi (without a visible panel) which generates continuous data to some global variables. Towards the end main.vi closes sensor.vi and goes about it's merry way.  

 

I am trying to continously read these global variables through the rest of mains sequence, but they don't update at all. Why so? They are updating in their own globalvariable.vi's.

 

I've tried reading pausing the sequence with a while loop in one frame to sit and read the globals, but there're not there.

 

All help much appreciated!

 

Confused,

Graham

array of strings + array of numbers ?= cluster of numbers with names

$
0
0

I have an array of strings.  They need to be cluster element labels.

I have another array of numbers.  They need to be the values of the cluster elements.

 

How do I make this happen?  I don't know any way to write a string variable value to the name of a cluster element.

 

Updating with things I find as I keep looking:

Excel Active X properties and methods issue.

$
0
0

Hello all,

 

I have a project that creates an excel workbook, writes data to it, then creates charts from this data. The charts have custom textboxes that I add using properties and methods (Attached below). I am running into an issue where not all of the textboxes have been appearing (examples also attached). I just recently replaced the computer at my test station with a windows 10 machine. All excel settings are the same. Am wondering if anyone has run into this before or have any indications as to the issue. I have had trouble finding resources to the specificity of the issue. Thank you!

Has anyone use an anywhere USB over ethernet from DIGI qith USB DAQ

$
0
0

I need to connect 9 USB-6353, 3 CanBus, 3 GPIB to one PC. I am looking into the anywhere USB 14 from DIGI International and I would like to know if any one has try using this items and how succesfull it was.


Plot line graph from array data

$
0
0

Hello,
I have a problem with ploting a characteristic. In my case values on Y axis are from 0 to 100 and values on X axis change with interval of 1 from 1 to 10. For example: if X = 2 I can have multiple Y values.

 

Firstly I've tried to use XY Graph but when X data was set, then the plot looks as in first attachment (xygraph.jpg).

Next, I've tried to use Waveform Graph and here characteristic looks good, but unfortunately the X axis default is Time and I don't know how to change it to my X values (1, 2... 10) for specific Y values.  

 

Greetings

FGVs may help avoid race conditions, but do they force execution order between loops?

$
0
0

I am looking at some popular documentation on FGVs where they are showcased as useful for avoiding race conditions in a parallel multi-loop secnario, but my question is what about forcing execution order?  Yes the FGV being a non re-entrant vi ensures  both loops cannot run at the same time (only one instance at a time), but then what about sequencing / execution order?

Can it then be said that if a diferent order of execution from one loop to another will affect the end results , FGVs may not suitable?

Verbindungsverlust bei cRIO-9075 im Hybrid-Modus

$
0
0

Hallo zusammens,

Ich arbeite mich gerade in LabView FPGA ein und habe ein Problem mit einem cRIO 9075 im Hybrid-Modus.
Ich benutze SoftMotion-FunctionBlocks um einen Motor über einen NI9514 anzutreiben. Bei erreichen einer bestimmten Position zeichne ich die Werte an Analog-Eingängen von einem NI9239 auf, zusätlich ein Positionssignal von einem Glasmaßstab, der über die Digitaleingänge eines NI9411 und den Softmotion Incremental Encoder Decoder abgefragt wird. Die Daten werden wie im 9239-Beispiel in einen DMA-Fifo geschaufelt.

Auf dem cRIO fahre ich nun über einen Straight-Line-Move-FunctionBlock auf Position A, dann auf Position B und zurürck auf Position A.
Auf der Strecke A-B möchte ich die Werte aus dem DMA in eine TDMS-Datei schreiben. Das löse ich zur Zeit über eine Stacked Sequence:
Erster Frame hat einen Move-Baustein, zweiter Frame hat den zweiten Move-Baustein und die Funktion zum auslesen des FIFO (über zwei verschachtelte Read-Bausteine, die verbleibenden Elemente des ersten an die Number of Elements des zweiten, das Array wird dezimiert und über Schieberegister ein neues für jeden Kanal aufgebaut. Wenn die Position erreicht ist beednet die Schleife, ein Array wird gebaut und in eine TDMS-Datei geschrieben. Danach folgt ein Frame mit der Fahrt zurück zur Ursprungsposition.
Zu Beginn wird die ScanEngine reinitialisiert (wie im entsprechenden Beispiel), die FPGA-Referenz geöffnet und der FPGA-Run-Befehl gesendet.
Der Reglerfreigabe wird auch gesetzt usw. und die FPGA-Referenz am Ende wieder geschlossen.

Das funktioniert auch wie gewünscht, aber nur ein Mal; beim zweiten Mal verliere ich die Verbindung zum Target, irgendwann währen oder direkt nach der Init-Sequenz. Dann muss ich den cRIO über MAX neu starten, die FPGA-Vi von Hand starten, die Achse neu deployen und es funktioniert wieder. Ein Mal.
Die CPU- und Speicherauslatung beobachte ich über den Distributed System Manager, beides bleibt im Bereich um 50%, daran scheint es also nicht zu liegen.
Muss ich sonst noch irgendwas beachten?
Ich bin leider gerade unterwegs und habe den USB-Stick mit dem Projekt nicht dabei, verzweifle aber gerae ein wenig an dem Problem. Daher hoffe ich, dass euch die Beschreibung schon mal weiterhilft. Vielleicht kann mich ja jemand in die richtige Richtung schubsen Smiley Happy

Vielen Dank schon mal im Vorraus,
Antje

How to make that multiple boolean switches can impact on the run of a loop, via Arduino UNO?

$
0
0

Hello! I'm a newbie in the LabView environment and I'm not familiarized to the functions the program offers. I'm making a simple Simon Says game using Arduino Uno through LINX. I've got stucked in the phase where it's the user's turn to repeat the shown sequence. Basically, the push buttons interact via "true" or "false" and I need the 4 "for" loops in order the 4 buttons to be detected in a certain lapse of time (I'm using a 100 ms duration of the loops so that the corresponding leds are lighted on briefly when pressed the push buttons), but I'm not sure if I'm handling properly the boolean results out of those "for" loops. Plus, I don't know how to stop the loop and exit it through multiple boolean conditions, if I connect them directly it would say that the "wired tunnel is undirected". 

I've also tried to handle the boolean responses with an "event" loop, but it seems that the event are only triggered if they're made through the "Front Panel" and they're not detected if using the Arduino Uno.

I'm attaching my VI, thanks in advance!

Shared Variable Deployment Failure

$
0
0

I am trying to run a shared variable over two PC's.  

I have two VIs (read.vi & write .vi)

On one PC, everything seems to work fine.  However on the second when I run the read vi the following error appears:

Initializing...
Calculating dependencies...
Checking items for conflicts. This operation could take a while...
Preparing items for download. This operation could take a while...
Deploying My Computer
Deploying XXX Shared Variable.lvlib\\192.168.120.1\XXX Shared Variable deployment failed (error: -1967362042, OS and Network Services: (Hex 0x8ABC7006) Unable to start service.).
Deployment completed with errors

 

I have disabled the firewall.  Repaired the LabVIEW installation and I have a professional license.  Does anyone know why the network service is not starting and is there a way to start it manually?

Viewing all 66670 articles
Browse latest View live


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