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

Stopping motor after elapsed time

$
0
0

Hi everyone,

 

I've recently inherited some code that I need to add some functionality to - one being making sure the motor and spray stop after the inputted time has elapsed. Unfortunately due to time and equipment restraints I don't have many opportunities to test this code before it is needed so I'd just like to check if I'm on the right track.

 

In the attached VI the changes I have made are to the stop condition in the bottom right while loop, changing it from just a stop button to also being dependent on the elapsed time. It does require the total test time to be entered twice though this is a rather minor inconvenience, albeit inelegant.

 

Does it look like the changes I have made will work?

 

Thank you for your help


Re: fuzzy logic - Labview

$
0
0

Sir how to create program fuzzy logic  on sbrio?

why my fuzzy logic file path can't detect when i run my real time vi?

LV2017 built EXE crashes - Channels behave bad??

$
0
0

I have a very strange problem with a project. I build an exe, which just crashes without meaningful error info. Right now I am trying to reduce the project to a smaller size an remove all confidential parts, so I could share it for troubleshooting. I build the application using LV 2017 32 bit. The top level VI launches just fine and works totally ok from the Dev environment. However when I launch it from exe, it just crashes. Sometimes just after launch, sometimes after a minute or so... One type of crash info is this:

 

crash1.png

 

First I thought the problem is with a DLL call, but even removing it still a problem. I also checked all dynamically called VIs, and all paths, all is ok (and they would produce meaningful error, not a full crash).

 

Another type of crash report is the following:

 

crash_at_end.png

another:

crashend2.png

 

The crash reports in respective order:

 

####
#Date: 17 Jul 2017 10:19:06
#OSName: Windows 7 Enterprise Service Pack 1
#OSVers: 6.1
#OSBuild: 7601
#AppName: MNVST
#Version: 17.0 32-bit
#AppKind: AppLib
#AppModDate: 7/17/2017 08:17 GMT
#LabVIEW Base Address: 0x52650000


InitExecSystem() call to GetCurrProcessNumProcessors() reports: 8 processors
InitExecSystem() call to GetNumProcessors()            reports: 8 processors
InitExecSystem()                                      will use: 8 processors
starting LabVIEW Execution System 2 Thread 0 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 1 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 2 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 3 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 4 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 5 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 6 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]
starting LabVIEW Execution System 2 Thread 7 , capacity: 24 at [3583124348.05353832, (10:19:08.053538323 2017:07:17)]

<DEBUG_OUTPUT>
17/07/2017 10:19:22.696
DAbort 0xF50EFD7B: 
c:\builds\penguin\labview\components\mgcore\trunk\17.0\source\MemoryManager.cpp(1273) : DAbort 0xF50EFD7B: 
minidump id: d61ee8f9-9b14-469a-9e11-836f31ae726f
$Id: //labview/components/mgcore/trunk/17.0/source/MemoryManager.cpp#4 $</DEBUG_OUTPUT>
0x527549D9 - lvrt <unknown> + 0
0x52E41CA9 - lvrt <unknown> + 0
0x52E2749C - lvrt <unknown> + 0
0x52FC9465 - lvrt <unknown> + 0
0x52FBE18A - lvrt <unknown> + 0
0x52FBE18A - lvrt <unknown> + 0
0x52FBE18A - lvrt <unknown> + 0
0x52FBE18A - lvrt <unknown> + 0
0x52FA5DD1 - lvrt <unknown> + 0
0x52FBE18A - lvrt <unknown> + 0
0x52FBE18A - lvrt <unknown> + 0
0x52F82FAC - lvrt <unknown> + 0
0x52CBEB91 - lvrt <unknown> + 0
0x52CAC6AF - lvrt <unknown> + 0
0x52F82F30 - lvrt <unknown> + 0
0x53009B3C - lvrt <unknown> + 0
0x52D6758C - lvrt <unknown> + 0
0x52D6786E - lvrt <unknown> + 0
0x52D67C7F - lvrt <unknown> + 0
0x52D678EA - lvrt <unknown> + 0
0x529A7E2F - lvrt <unknown> + 0
0x529ACFDF - lvrt <unknown> + 0
0x529A969F - lvrt <unknown> + 0
0x529A9127 - lvrt <unknown> + 0
0x52997CEB - lvrt <unknown> + 0
0x52996E70 - lvrt <unknown> + 0
0x52999E86 - lvrt <unknown> + 0
0x52C2DD8E - lvrt <unknown> + 0
0x52C2DFD0 - lvrt <unknown> + 0
0x52E9D240 - lvrt <unknown> + 0
0x52F28183 - lvrt <unknown> + 0
0x52E9CB3C - lvrt <unknown> + 0
0x527D0942 - lvrt <unknown> + 0
0x527D1274 - lvrt <unknown> + 0
0x527D275A - lvrt <unknown> + 0
0x52E8B18A - lvrt <unknown> + 0
*** Dumping Bread Crumb Stack ***
*** LabVIEW Base Address: 0x52650000 ***
#** DisposeInstrument: "C:\_TLK_work\03--MNVST_project\_LabVIEW_stuff\MNVST_LV_project\builds\MNVST\MNVST_0.1\MNVST.exe\Users\Andras\Documents\LabVIEW Data\2017(32-bit)\ExtraVILib\ChannelInstances\Stream-t'Data_descriptor.ctl'\)Channel.vi"
#** VILinkObjRemoveCore: "C:\_TLK_work\03--MNVST_project\_LabVIEW_stuff\MNVST_LV_project\builds\MNVST\MNVST_0.1\MNVST.exe\Users\Andras\Documents\LabVIEW Data\2017(32-bit)\ExtraVILib\ChannelInstances\Stream-t'Data_descriptor.ctl'\)Channel.vi"
*** End Dump ***
####
#Date: 17 Jul 2017 10:23:01
#OSName: Windows 7 Enterprise Service Pack 1
#OSVers: 6.1
#OSBuild: 7601
#AppName: MNVST
#Version: 17.0 32-bit
#AppKind: AppLib
#AppModDate: 7/17/2017 08:17 GMT
#LabVIEW Base Address: 0x52650000


InitExecSystem() call to GetCurrProcessNumProcessors() reports: 8 processors
InitExecSystem() call to GetNumProcessors()            reports: 8 processors
InitExecSystem()                                      will use: 8 processors
starting LabVIEW Execution System 2 Thread 0 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 1 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 2 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 3 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 4 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 5 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 6 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]
starting LabVIEW Execution System 2 Thread 7 , capacity: 24 at [3583124583.22498941, (10:23:03.224989415 2017:07:17)]

<DEBUG_OUTPUT>
17/07/2017 10:23:20.700
DAbort 0x0037C03D: 
c:\builds\penguin\labview\components\mgcore\trunk\17.0\source\MemoryManager.cpp(1426) : DAbort 0x0037C03D: 
minidump id: 31db4400-d2a6-4343-b14d-09820f92866f
$Id: //labview/components/mgcore/trunk/17.0/source/MemoryManager.cpp#4 $</DEBUG_OUTPUT>
0x527549D9 - lvrt <unknown> + 0
0x52E41CA9 - lvrt <unknown> + 0
0x52E2749C - lvrt <unknown> + 0
0x52E204B1 - lvrt <unknown> + 0
0x52FCE268 - lvrt <unknown> + 0
0x0C3224DA - <unknown> <unknown> + 0
0x0C37067C - <unknown> <unknown> + 0
0x530030D6 - lvrt <unknown> + 0
0x52FFEEDA - lvrt <unknown> + 0
0x52E27DC5 - lvrt <unknown> + 0
0x7585336A - kernel32 <unknown> + 0
0x77B19902 - ntdll <unknown> + 0
0x77B198D5 - ntdll <unknown> + 0
0x00000000 - <unknown> <unknown> + 0

The only meaningful crash info (at least for me) is that the crash has something to do with my Stream channel ("Dumping Bread Crumb Stack" : ....

DisposeInstrument: Stream-t'Data_descriptor.ctl'

VILinkObjRemoveCore: Stream-t'Data_descriptor.ctl'  .......)

 

I will test this project on another PC, and see if it crashes there as well. We will be able to use this application run from the Dev environment, but I like to create an executable, more lightweight. So I hope i will find a solution...

If I get new info during this bug search, I will share it here. And of course any hints/help are welcome! Smiley Happy

Connect 2 different text strings to the same case structure

$
0
0

Hi there!

I want to connect different text strings to the same case structure, I researched about it and foun the concatenate strings function. But I dont want to concatenate them I want the words of each string enter the case structure alone. I obtain the words of this strings from different procceses, but I need to enter booth in the same case structure. 

How can I achieve this without concatenation?

 

Thanks!

dll generated with function prototype in VI description causes issues.

$
0
0

Hi I've found what I can only assume is a bug in the Application builder dll generation.

I'm have written a dll in Labview containing several functions and am calling these functions from TestStand.

I have come to document the functions more fully and have added to the VI description the function name, a description and a list of inputs and outputs. This information then gets copied to the header file generated along with the dll as I wanted.

However, when I reload the prototype in my TestStand sequence step (or create a new step and call this function) the parameter list is empty and TestStand claims the function returns a void.

After a fair bit of palaver I have found the cause of the issue to be the fact that the name of my function in the VI description is proceeded by parentheses

e.g. functionName().

and Labview when generating the dll appears to treat this text as a function prototype itself with no parameters and no return type.

The workaround is to remove the parentheses and then everything is ok, but Labview shouldn't be looking in this VI description at all when generating the dll, should it? To me it should just copy VI description to the header file as a comment.

Has anyone else seen this behaviour?

Blinking wont work

$
0
0

Hi guys,

please for an advice how to fix it. As the picture shows... I want a blinking led while the program wait. In this program the led is still blinking, even if the wait part is over. What to do?

Changing the phase of the signal

$
0
0

Dear,

I am generating a voltage signal by simply adding one to the digital values until a maximum desired voltage is reached.

I however have one question. How can I obtain the phase of the signal and secondly what can I do to change the phase of the signal generated.

I have attached my code below. Any suggestions will be highly appreciated.

 

Thanks.

 

Best Regards,

Benvalet

Create a time trial program to compare the average execution times of the formula node and the native labview functions

$
0
0

 

Create a time trial program to compare the average execution times of the “Formula Node” and the native LabVIEW Math Function. This program will require a For Loop, a Flat Sequence Structure, and a Case Structure. The For Loop is required to run the time trial N times and then the results can be averaged using the “Statistics” function in the Probability $ Statistics sub-palette. The Sequence Structure is required to sample the “Tick Count” before and after the code executes. The Case Structure is required to determine whether the user would like to execute the Formula Node or the native LabVIEW Math Functions. To test the timing, using the following formulas:

a = X^2 / 4;

b=(2*X)+ 1;

Y=sin(a+b);

 

this is a homework question, but I have run into a wall. If you could help me or atleast let me know where I should research then that would be appreciated Smiley Happy

1. Tick Count is not re-initializing

I run the program and tick count just gets larger and larger.

2. Tick counts before and after are the same so when i subtract the tick count of before and after (then divide by sample size to get average time) I get 0 or "infinity".

I either do not fully understand tick count but I think it just times your program or the flat sequence structure, I made three frames but why is tick count before and after the same. Would stacked be better?

 

Thank you! By the way, I'm using LabVIEW 15.


Looping move absolute position method - Thorlabs MLJ050 Motorized Lab Jack - Activex

$
0
0

I want to be able to specify an absolute position for the motor to go to and the number of steps to take, i.e. move a total of 20 mm in 2 steps, so the motor should move 10 mm, wait some amount of time, and move the last 10 mm. The user would specify the distance to move and the steps to take and then press a 'go' button. 

 

I am utilizing Thorlabs APT software (with LabVIEW 2016) with activeX methods: SetMoveAbsPos which sends a command to the MoveAbs method. However, I can't get the SetMoveAbsPos command to loop with the number of steps. With the attached VI, the behavior I am getting is that the position input from the user is updated every time the VI loops. For example, if the user inputs a position of 20 mm and do it in 2 steps (cycles control in the VI), it will go to 10 mm, then moves to 5 mm, and then to 2.5 mm, etc. I have tried different positions (inside vs outside the for loop) for the SetMoveAbsPos command and I have tried to initialize the position control outside the loop but I don't get the results I want: either the motor moves to position/steps and doesn't loop or I get erratic behavior. 

 

Is there anyway to somehow loop the SetMoveAbsPos method for the number of steps I want without it updating the user input position value?

cDAQ-9178 Sync Digital and Analog Modules

$
0
0

Hi, everyone:

First time poster here.  I’m new to LabVIEW and was wondering if someone could tell me if the code I wrote is doing what it's supposed to do.

What I’m trying to do:  I have a cDAQ-9178 chassis with 5 NI modules installed in the following slots:

  1. NI 9216 (using 8 channels: RTD sensors)
  2. NI 9237 (4 channels: strain gauge)
  3. NI 9421 (8 channels digital input: relay activation and process step reading)
  4. NI 9472 (4 channels digital output: relay group select)
  5. NI 9205 (Voltage input from external instrument: DEA 288)

The NI 9472 outputs a voltage that selects one of four relay groups.  The other four modules record data.  The relays are part of a multiplexer that selects a subset of sensors.  I was asked to provide an effective sampling frequency of 10 Hz for each of the four channels.  Therefore the system runs at 40 Hz.  Ideally, I would have all 5 modules in sync, with the NI 9472 (Voltage out) leading the measurements by ~4 ms (the time it takes the relays to change states and stabilize). However, I was unable to do this.  If I put the measurement components in the relay-control loop, everything slows down to about 1 Hz.  Also, my understanding is that without the FGPA module, perfect timing of the NI 9472 is impossible (at least for what I need it to do).  Therefore, I settled on a slightly less ideal approach:

  1. Run the NI 9472 (Voltage out to relays) using the LabVIEW software at a nominal 40 Hz.
  2. Run all measurements in sync with each other (but out of sync with the 9472).  I'm currently running all four measurement modules at 2kHz and down sampling to 40 Hz using the last data point.  It seems like a waste, but I was unable to get them to all run at 40 Hz.
  3. Measure the relay voltage (using the NI 9421) so I know what relay group was actually activated in post-process.
  4. Throw away bad data points in post-processing (points that were measured while all relay groups were open, or multiple relays were closed).  So far, what I'm seeing is that about 0.5% of the time there will be two relays open at the same time.  I will throw away those data points or potentially replace them with interpolated data.

I think the attached VI achieves this goal.  However, it's hard to know if everything is doing what I think it’s doing.  So my concerns are the following:

  1. Are all four measurement modules starting at the same time?
  2. Do all four measurement modules use the same clock?
  3. Are there any other misses or bad practices in this code?
  4. Is there a way to sync the NI 9472 with the measurement modules?
  5. In general, is there a better way to approach this problem?

Thanks in advance

njspeer

How to draw a diagonal line profile with correct size?

$
0
0

Dear NI community,

I'm trying to make a diagonal line profile of an image (3840*2748). When I used the LineProfile.vi to do this work I always get an array of 3840 pixel values, which is not the length of the diagonal. Is there any way I can change this? or it's pre-determined by the algorithm of the vi.

Thanks a lot!

Rosh

Link problem building PPLs with LV2017

$
0
0

Moving a large project to LV 2017, from LV 2013.

 

Compiles fine in LV2013, been working for years.

 

i now get an error when trying to build one of my PPLs.

I am sure that all prerequisite PPLs have been built and saved in LV2017.

i get this error:

Screen Shot 2017-07-17 at 12.09.41 PM.png

Of course, searching the "support" page is still useless, so I don't know what it's complaining about.

 

The code in question is here:

Screen Shot 2017-07-17 at 12.11.00 PM.png

 

You can see that this VI is NOT broken here. But when I BUILD this into a PPL, it SEEMS to build OK, but then complains after saving things.   And it's not smart enough to TELL me what it's doing. I don't know what file it's trying to write.

 

If I disable BOTH of those VI calls in the lower right, the error disappears (but of course won't do what I need). Disabling either one by itself is not enough.

Both those VIs are in a previously built PPL called ADDON TOOLS-RT (which was compiled for RT, but has been used on both RT and Windows for some time). Here is one of the VIs.  It uses a TypeDef called UNIT SELECTOR, which is in a separate PPL called Addon DataTypes.lvlibp.

If that TypeDef was the problem, then disabling the VI calls wouldn't cure it, i wouldn't think.

Screen Shot 2017-07-17 at 12.14.14 PM.png

 

So, what is happening?  How do i find out what the real problem is?  What file is it trying to write? "Missing external dependencies" is so generic as to be useless.

 

Ideas?

 

Help with thermocouple channels

$
0
0

I'm currently trying to read Thermocouple data on 30 channels. The thirty channels are divided up on two cartridges(channels 200 and channels 300). However anytime it tries collecting data from the 300 channels(301-312) it turns off.

2D array, Array Subset, a fast methode

$
0
0

Hello,

 

I need to access data from a shift register where I store 40 rows in a 2D array of column size of 86400. I need to read out 12 rows arbitrarily picked from the 40. Also, a start and end index is varied to select subset of the rows, but the same start and end index applied for all 12 rows. The following snippet comes to my mind, I wonder if there is any way to do it better. If I configure iteration parallelism for the FOR loop, I guess it can help? Or the compiler anyway will optimize it for multicore?

thanks!

 

array2D.png

Time display is blinking

$
0
0

Hello, I preparing customized stopwatch applications. I want refresing time a hundredth of second. In front panel I am using numeric front panel where is displayed time in hundredth of second. Time value is blinking and this is not so friendy for users, could anybody know where is reason for that. 

 

Time display blinking.png

 


LVOOP Device class implementation. How should I start?

$
0
0

Hello everyone,

 

I am having some trouble lately trying to understand how to work in LVOOP. I did create some programs that used objects I designed before but they always used some tricks to get around what I really wanted. Also excuse me for using any term in a misleading way. I am really bad with those. I know I need to learn.

 

Currently I am so confused I no longer understand how to even start.

 

I want to simulate an object of oscilloscope for which I have a DLL. If someone is curious as to which oscilloscope it is HandyScope HS5 from TiePie. I programmed HandyScope HS3 (earlier model) to make a device called HS3 consisting of Generator (inherited from class CGenerator) and encapsulating two objects of class CBasicChannel. I would prefer to use multiple inheritance here and inherit two channels then use something along namespace to decide which data to acquire and set. This would allow me to use a single instance to set values of anything in handyscope. To show you what I mean and what I did I add ss2.JPGss3.JPGss4.JPG

 

I also wanted any class inside of my build to have a semaphore shared between inheriting classes... simply so no two methods would try to access DLL or data at the same time. After all I use it in parallel.

 

I thought I could inherit the class CBasicChannel twice with multiple inheritance and create classes CChannel1 CChannel2 then inherit them in main class. I know multiple inheritance creates problems in other languages but I am pretty bad at OOP design.

 

So how should I go in trying to simulate a virtual object of a real existing device? What if the device has several entities of the same thing inside? Like channels or sensors? How should I start to build it so it will look simple yet work properly? Should I use any of common design patterns (they get me really confused)?

 

An example would be appreciated. Especially at making a hierarchy. I tried turning inheritance upside down and inheriting from handyscope then creating objects of class "channel" and "generator" but I'd prefer to have a single entity? Or am I stupid for trying that?

 

I am really lost here. Thank you in advance for any replies.

Close a SubVI from the main VI.

$
0
0

   I have a main vi that calls a SubVI in which a front panel comes up for the user to use. The SubVI has a close button, but if someone closes it another way ("X" button at the top, ctl+w, or whatever) then the program is stuck, waiting for the SubVI to stop running with no way for the user to stop it.

   I've made it so the "X" button cannot be used by the user but in case there are other creative ways to close the window, I would like to have some code in the Main VI that ends the SubVI when the front panel is closed. You can use a VI property node to check the state of the SubVI front panel but I have not found any way to close a SubVI from the Main VI.

 

   Does anyone know if this is possible and how to do it? Thanks.

Active X AlertBrowser Slow to initiate

$
0
0

Active X component is very slow to launch; in below image, the part that is circled takes about 7 seconds to execute.

AxtiveX.JPG

After the Action Log becomes active, it works well.  Just takes too long to launch.  Any ideas?

Labview 2015 Pro, DSC Module, Windows Server 2012 OS

OPC UA Server on RT (Dev Env vs RT EXE)

$
0
0

I am working on an app for OPC UA where the Server is supposed to be hosted on the cRIO-9064, LabVIEW 2016.

In Development Environment it works fully and the OPC UA Server is created properly and the tags etc.  I can connect a client from my PC with no issue.

 

Am I missing a step to allow the OPC UA Server to be created in an RT EXE environment?

 

When I compile the RT EXE and it runs on the cRIO - the exact same code runs and the Server goes through the same steps, but when it comes time to create the tags, I am getting error -356500 "LabVIEW: (Hex 0xFFFA8F6C) An internal error occurred as a result of a programming or configuration error."

 

The Server is created before the Tags are added, but the Server is not started until after the tags are created. 

Drive analog outputs by edges of pulses

$
0
0

Hi, I wanted to generate signals on two analog outputs every time the counter output changes state (both rising edge and falling edge). The pic shows more details:

File_000 (4).jpeg

As you can see, there are four states on the two analog outputs: (0, 0), (1, 0), (0, 0), and (0, 1). The values repeat from the beginning every two counter raising signals, and whenever the counter changes state, the analog outputs would step through those values. 

 

 

My counter output can generate two pulses when an external source comes in, and it is working well. What I haven't figured out is:

1. How to use the counter output as clock source for analog outputs.

2. How to generate a set of analog outputs one at a time whenever the clock edge changes.

ao_counter.png

 

Viewing all 69084 articles
Browse latest View live


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