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

xcontrol file location

$
0
0

How do I determine the file loaction of an xControl?  I am using the Vibration Logger (DAQmx) project as a base.  I know that the control on the DAQmx tab is an xControl.  I can not seem to find an easy way to find the location of the original file as I would like to modify this.  I can find the location by clicking the xControl, selecting Advanced/Show Diagram.  If i close the main VI I can then Go to Operate and Change to Edit Mode which will then allow me to view the VI properties where I can see the file location.  This seems rather compicated to me.


Write to spreadsheet adds carriage return

$
0
0

I am using build array function to put together a number of strings and build an array of strings.  The build array is in a while loop.  A new line is added to the array every loop.  I am using write to spread sheet function to save the spreadsheet to a file with xls extension.  For some reason, a carriage return is inserted within the array.  The array has 9 columns and a carriage return is put after the fourth column.  I have not added this carriage return.  Does anyone know why write to spreadsheet might automatically add a carriage return and how to remove it?  

 

Thank you!

rt shared variable from cRIO to computer without loss

$
0
0

Hi

So i have a cRIO 9030, and its going to make some measurements for me, and i originally wanted to send them in to a database, but since database connectivity dose not work on RT I need to get the data though another computer.
I can´t afford to lose data, so I though make a queue on the cRIO where my data is filled in and then share one variable, that variable I then want to read from a Windows Labview and send to my database. But the cRIO needs to make sure that the data have bin sent to the Windows Labview successfully. First I thought I make a RT Fifo share and I would get a error if I fill it, but that is not the case.

I have made a small example where the cRIO makes data with a 10 timers higher rate than the Windows reads, meaning I would get an error if I try to fill it, or so I thought.

Any ideas on how to get data safe from my cRIO?

project.pngvis.png

A File Reference and its evolving life!

$
0
0

Hi all,

 

I've noticed something that came as a little bit of a surprise to me, but I think I have the explanation, at a hand-wavy higher level anyway.  What I have not established is if this is a 'bug' or a 'feature', and if there are any ways the following issue can be avoided at the NI function/api layer.

 

Consider the file open and file close function.  You open a file, you use the reference to the file to write/read data, then at some point you close the reference and the close function spits out the file-path.  Here are a couple of tid-bits you may not be aware of (that are easy to test):

 

Q1) After your application opens/creates a file and starts using the file-reference to make file writes, if an external source changes the file-name of that file... guess what will happen on your next write function call?

A1::  The write successfully updates the newly re-named file with your new data without producing an error or a warning.  (At least this is the case if your program is running on a vxWorks cRIO target and the file-name is changed directly on the cRIO via an FTP browser.)  

 

Did this surprise you? It did surprise me!  -My handwavy explanation is that the file-pointer is perhaps managed/maintained by the OS, so when the OS tells the file-system to rename that file, the pointer that LabVIEW holds remains valid and the contents of the memory at the pointer location was updated by the OS.

 

Q2) Continuing from the situation setup in Q1, after writing several new chunks of data to a file now currently named something completely different than when the file reference was originally created, you use the close function to close the file-reference.  What do you expect on the file-path output from the close function??  What do you actually get??

A2::  The close function will 'happily' return the ORIGINAL file-name, not the actual file-name it has been successfully writing to(!).   This has some potentially significant ramifications on how/what you can use that output for.  At this point there is a ton of room for pontifications and more or less 'crazy' schemes for what one could do, but I argue that the bottom line is that your application has at that point completely lost the ability to accurately and securely track your file(s).  Yes, you could list a folder and try and 'figure out' if your file-name was re-named during writing and you can in various ways make more or less good 'guesses' on which file you in reality just had open, but you can never really know for sure.

 

So, what do you guys think?? Is the behavior of returning the (incorrect) original file-path when you close the handle a BUG or a FEATURE?? Would it not be possible for LabVIEW to read back the data contained in the (OS?) pointer location and as needed update the file out path data when it closes a reference?  Should we not EXPECT that this would be the behavior?

 

Q3)  Again, continuning from the above situation, lets assume we are back at the state in Q1, writing data to a (re)named file.  What happens if the file is deleted by an external process? What happens to the file reference? File function calls using the reference?

A3::  This one is less surprising.  The file reference remains 'valid' (because it is a valid reference), but depending on the file function you are calling, you will get error such as error 6 (binary write reports this), or error 4 (a TDMS write will report this error), etc.  So as long as you don't rely on file ref-num tests to establish if you are good to go with a file-write or file-action, you should be safe to recover in an appropriate way.. Just don't forget to close the file-reference, even if the file is 'gone', the reference will still remain in memory until you 'close' it (with an error)(?I might be wrong about this last part?)

 

 

I am not sure if the above is possible on e.g. Windows, Windows would probably prevent you from re-naming a file that has an open file-handle to it, but this is definitley observable on at least vxWorks cRIO targets.  (I don't have PharLap ETS or RTLinux devices so I can't test on those targets.. if you want to test its pretty straigth forward to make a simple test app for it.)

 

 

 

[begin rant-mode related to why I found this out and why this behavior BITES]

There are situations where the above situation could cause some rather annoying issues that, for somewhat contrived reasons related to cRIO file API performance, CPU and memory resource management, are non-trivial to work around.  for example, using the NI "list folder" to listing folders take a very hefty chunk of time at 100% cpu that you cannot break up, so polling/listing folders after every file update (or even on a less regular interval) is a big challenge, and if you are really unlucky (or didn't know any better) and gave the list command in a folder with 1000's of files (as opposed to less than about 100 files), the list will lock your CPU at 100% for 10's of seconds...  Therefore, you might be tempted to maintain your own look-up table of files so that your application can upload/push/transfer and/or delete files as dictated by your application specific conditions... except that only works until some prankster or well-intention person remotes in and starts changing file-names, because then your carefully maintained list of file-names/paths' suddenly fall appart. :smileymad:

[\end rant]

 

 

 

Could not retrieve configuration data from target Error (Web Server)

$
0
0

Hi everybody,

 

I'm running into an issue whenever I try and configure the web application server. Whenever I try and open the web server configuration page it opens up the page in the browser and loads silverlight, then it pops up a window which says

"Could not retrieve configuration data from target. This could mean that the target's web server is temporarily unavailable or that your installation is corrupted. Please refresh your browser. If this problem persists, please contact National Instruments support".

 

- I've tried to look online for a solution but came up empty

- I was concerned about the corrupted installation bit so I repaired my labview installation

- This feature has worked for me in the past (up until last week actually)

- Is it possible that my companies IT department decided to suddenly start blocking the Labview server? (Cause that's all I can come up with right now

- I'm running Labview 2012

 

Any help would be greatly appreciated

 

Packed libraries and class hierarchy issue - error 1448 : Bad Type Cast (with classes)

$
0
0

Hey folks,

 

I'm currently attempting to figure out if (and how) I can utilize packed libraries for a project using LVOOP.  I started out by looking at a demo of the plug in architecture : https://decibel.ni.com/content/docs/DOC-19176

 

I watched and read some ppt's on the idea and thought I was begining to understand the ideas here so I attempted to make a super watered down simple approach to using packed libs...

 

If someone could tell me where I went wrong here' I'd appreciate it, kudos to anyone willing to try and help!

 

I created a project in which I made parent class "jawn", and two child classes "subjawnA" and "subjawnB", all having one method named "Jawn1". (inheritances set in properties)  All this method does is pop up and tell me which method executed.

 

I then built three packed libraries, Jawns.lvlibp, SubJawnA.lvlibp, and SubJawnB.lvlibp.

 

In a new project, I add these packed libraries and I basically used the same code in the example for fetching the packed libraries and their contents.

 

The parent class works just fine when I select it from the pulldown and hit play, but the child classes give me error 1448 saying its a bad cast.

 

One thing I noticed:

 

the parent that works:

http://imgur.com/0uXkeI9

 

child with the error:

http://imgur.com/9hENAzG

 

Thanks again and kudos to anyone willing to help me out here!

 

-pat

 

edit: attaching zip file of project... (LV2013)

 

 

Please open this VI and screen shot for me.. thanks

$
0
0

Could any kind soul here, please open up this VI and post the screen-shot the block diagram here?

I need to look at the block diagram now but I do not have LV installed on my current computer.

It is a LV2010 vi.

Many thanks..

Front panel resize delay

$
0
0

Hello,

 

I am developing GUI that needs to look nice and user will have option to resize it. Since scale as the window property works bad I wanted to use panel resize event.

But there is delay - controll is resized some time after I resize front panel and that looks bad. When I look on project window or error list it resizes instantly. 

Why I can't achieve that result in Labview??

 

I could always read panel size lets say every 10ms and calculate ontrolls size based on that,  but is there better option using this panel resize event??


Executable files

$
0
0

Hi everyone

 

First sorry my english!

 

Well, I would like toopen the notepadand then immediatelyopen theedit option,allautomatically.

 

But,  is it possible?

 

thank you

i am doing one Labview project. so my project is about design a interface in labview which one collect the data from keithley 2400 via GPIB connection.

$
0
0

i am doing one Labview project. so my project is about design a interface in labview which one collect the data from keithley 2400 via GPIB connection. any suggestion please

Labview is randomly dropping 4 or 5 bytes from the front of serial reads

$
0
0

I posted about this in the VISA forum, but there appears to be no traffic, and this appears to be a software problem anyway. I have a serial device which is supposed to echo any commands you send it and then come up with a firther response. My problem is that LabView is dropping the first 4 or 5 bytes of the echo, and there's no clear pattern about whether it's 4 or 5 bytes. Using a terminal I can get the desired response:

 

$ echo -en '\xFA\x30\x4\x43' > /dev/ttyr02

$ od -x < /dev/ttyr02
0000000 30fa 4304 30fa 4304 30fa 050a 2e06 010a
0000020 9478

 

This is doing the right thing at the operating system level, but Labview consistently refuses to read the first 4 / 5 bytes. Has anyone seen anything similar in the past? I'm tearing my hair out. The thing is, I can use LabView to write random bytes to one serial port, read from another through a null modem cable, and whatever I write comes back fine. So there's no consistency. Is 0xFA some sort of special character of which I should be aware?

How to add a page break to word report

$
0
0

Hi,

 

    Is there a way to add a pagebreak (start a new page) to word report? Thanks!

 

   Tom

detect where a threshold crosses a peak

$
0
0

I want to be able to detect the point at which a threshold crosses a peak as shown in the figure, I know that the threshold VI will give me the point A but I also want to be able to get the point B, any ideas?

image of peaks.jpg

 

modelsim and LV 2014

FYI TDMS open and read on empty file gives no error's out

$
0
0

I found that if you 'open' an empty (0 byte) file using TDMS open, you will not get any error messages when you open it, nor when you call functions such as "Get properties" or "List content", also no error when you close the TDMS file.

 

If the file is non-empty, but not a valid TDMS file, TDMS open returns an error.

 

I would have expected that I would get an error or a warning at least when trying to read a non-existant property or group, if not by the open function itself?!

 

The 2013 snippet below creates a 1-byte or empty file in the local user temporary folder, closes the file, then attempts to open and read it as a TDMS file.  The temporary file is deleted afterwards.

If the file is empty, NO errors or warnings occur at any point.  If the file is not empty, it fails on the TDMS open. (Note the sequence structure is because the path out of the tdms close is invalid if the tdms open failed.

 

This could conceivably cause an issue if your program does not do additional fault checking to catch existing but empty files.  (Which of course shouldn't ever happen, but in some situations it could happen.)

open empty TDMS file.png


usb-8451 library installation

$
0
0

I have a USB-8451 device. I have installed the drivers, but there are no NI485x VI on the functions pallet. Also, there are no example is the example finder, which I assume there should be. I tried downloading some examples from this forum, but I can't open them because the Ni485x VIs are not installed on my system. The drivers are installed.  I don't see a link to any other installations on the product support page.

 

How do i install the USB845x software support?

 

Edit: OK, I figured it out. The drivers I installed do not support LabVIEW 2010. I installed the old drivers, and it works.

Add axis label to a graph in word report

$
0
0

Hi,

 

    Is there a way to add an axis label for the graph in a word report? Thanks!

 

   Tom

LabView hangs after calling DLL

$
0
0

Hello,

 

I am working on a library that makes calls to other DLLs, that are linked dynamically.

To do so, I have to customize the DLL search order before the call and add some custom directories (where the called DLLs are).

The called code runs fine, and doesn´t leak any memory within the called DLL, however LabView hangs.

 

 

It took me some time to figure this out, so I hope this helps someone in the future. Bellow is the solution.

How to get individual history of multiple plot waveform chart

$
0
0

I have a waveform chart with multiple plots, which is take a cluster as input.

 

I want to calculate the mean of each of those plot. With single plot waveform chart, All I needed to do is to use the Chart's History property node and pass the history to the build in mean vi. With the multiple plots chart, I am unable to get the history of each plot.

 

The History property node of the multi plot chart is an array of custers, not quite what I need to calculate mean. 

 

How to I get history of individual plots?

 

Thanks.

 

 

Bit stream using myDAQ

$
0
0

Hello.

 

I am new to Labview. I want to have stream of bits to be line coded using some technique such as Manchester coding, RZ etc and the modulate the signal and transmit over a channel using myDAQ.. I want at the other end of the channel to retrieve the signal, demodulate and decode. Finally I want to compare the sent bit stream and the received bit stream hence calculating the BER. My channel is a power line communication channel and I already have my coupling circuits.

 

Thank you.

Viewing all 69566 articles
Browse latest View live


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