Quantcast
Channel: All LabVIEW posts
Viewing all 204074 articles
Browse latest View live

Re: Arbitrary waveform generation and looping that waveform

$
0
0

Save the PNG file to your desktop.  Then drag that file into your block diagram.  If you are using LabVIEW 2019, then you'll have the code!


Re: Writing LV program to communicate with ADAM-6017 using Modbus TCP/IP

$
0
0

1.  Change that to DDT Express VI bullet to be 1D array of scalars single channel  to 1D array of scalars multiple channels.

 

2.  Yes, you can convert from the U16 value to something  in mA or engineering units.  You just need to know what the conversions are for each register and do the math.   Think y= mx + B.  The only thing that will be difficult is how to know which instrument as which scaling?  You've got the same problem now, you just have to figure out a way to get that info into your LabVIEW program so that it can do the math for you.  It might be a matter of reading a configuration .ini file.

 

3.  Yes, you'll need 3 different masters, one that opens each IP address.

 

Re: Reading 12 daq cards with 16 channel each

$
0
0

Rejoining the conversation, a lot's been going on since I last checked in.

 

1. My typical bias in Windows is to make the DAQ loop as lean as possible, because the buffer overflow error that could happen if it bogs down is irreversible.  On the other hand, if a consumer loop bogs down, it just makes a backlog build up in the queue.

    This thinking may not be fully appropriate for RT where the RTFIFO has a fixed size.  Thus, a consumer loop that bogs down has more drastic consequences, possibly leading to data loss.  (If I recall correctly -- it's been a *looooong* time since I last used RTFIFO's under RT.)

    So I'm now thinking it may be reasonable for your DAQ loop and your consumer loop to each have some but not all the demanding stuff (data copying, memory space, CPU usage)

    Your DAQ loop has the DBL->SGL conversion and the data copy into the fixed size array.  This might be further copied when pushed into the RTFIFO, I'm not sure.  Your consumer loop will presumably just wire from the RTFIFO "dequeue" output to the network stream "write" input.

    It seems to me that you'd balance the load better by doing the DBL->SGL conversion in the consumer loop.  Your fixed size producer loop accumulator array would use 2x the memory this way, but it never grows so should be ok.   (Though the question is begged: why the big mismatch between high-end 24-bit DAQ devices on one hand and a file format that only supports SGL precision on the other?).

    Reading raw 32-bit integers instead of DBLs remains an option, but based on recent info in the thread I'd now look to do the scaling to SGL in the consumer loop.

 

2.  The suggestion from mcduff about channel expansion sounds like an excellent idea to me, provided your devices support it.  

 

3.  I only ever once worked a project that used a Time & Sync device similar to the 6674T.  I think I remember it being able to generate an almost infinitely variable but high frequency clock via DDS.  I could then route this clock out to a PXI trigger line (or maybe some more special signal line on the backplane?) from which the DSA devices could use it as a timebase for deriving their own sample clocks, according to rules like those in the linked manual.

    So it makes sense to me that the right choice of DDS clock frequency would allow for a pretty precise 100 kHz sample clock frequency.

 

4.  The posted snippet has quite a few unwired error ins/outs.  The real code doesn't ignore errors, right?

 

 

-Kevin P

Re: Reading 12 daq cards with 16 channel each

$
0
0

I found that Channel Expansion works for almost any combination of cDAQ devices, for PXI, much more limited. The OP has identical cards which should work for Channel Expansion.

 

mcduff

Re: Arbitrary waveform generation and looping that waveform

$
0
0

Sorry, our institution has provided us with the 2013 version. This feature is not working in this version.

Re: Arbitrary waveform generation and looping that waveform

Nyquist criterion was ot be fulfilled

$
0
0

I used NI 9201 as my DAQ card to read my piezoelectric sensor (unimorph). my cut off frequency is supposed to be 500 HZ but could not insert the value in the filter (as it already mentioned that it has default only 400 HZ). and it keep appearing in my filter that " the current filter specifications do not meet the Nyquist criterion for the given input signal" . How do i solve this problem and is there any mistake with my procedure?

Re: Club two packet structure along with data and send separately

$
0
0

Yes I can use multiple UDP's but I want to send the data on a particular port only. Doesn't it create a conflict when I use multiple UDP write with a same port number?


Re: Doubt regarding Graphs

$
0
0

If your dt is 50ms, then that's 0.05 seconds per sample. So set the multiplier to 0.05 and you'll get seconds.

More generally, if you have

 

t(Sample N+1) - t(Sample N) = num samples (1) * multiplier = dt

 

it will give you what you want. Not sure if that is a better explanation or not, hope it helps a bit.

Turn on Scripting programatically

$
0
0

I'm creating a plugin for selecting properties and methods, and I need to have the plugin create helper files with property and method info for the plugin to use on subsequent runs. I would like these files to contain private and scripting properties and methods, even if those are not turned on in the user's ini file and preferences. (Thus, the file will have the properties available if the user turns on those features)

 

I think I can turn on private methods programatically by temporarily modifying the LabVIEW ini file. However, I can't figure out how to temporarily turn on scripting. 

 

I did find a private application method called Allow Scripting, but when I run it it gives me Error 1036:

 

Capture.PNGCapture1.PNG

  

Any ideas how I might accomplish this? Or should I simply rebuild the files in the event that the user turns on these options?

Re: Club two packet structure along with data and send separately

$
0
0

 wrote:

Yes I can use multiple UDP's but I want to send the data on a particular port only. Doesn't it create a conflict when I use multiple UDP write with a same port number?


Presumably not. Otherwise, how would you ever send a second message? For example in a loop - surely you wouldn't want to send to a different port every iteration?

 

Given your writes have different formats, you'll need to handle that at the receiver (because it might not know which format is coming next, depending on your code design). So make sure it could in principle handle them individually (even if you want it to be an error if a DA2 packet arrives without/before DA1 etc).

 

Some notes now that I'm searching through your code:

  • Why are the front panel controls miles apart in distant locations? If you don't want some control to be visible, you can hide it by (on the block diagram) right clicking and choosing Hide Control (or Hide Indicator), or on the Front Panel by right clicking and choosing "Advanced > Hide {Control,Indicator}". Please don't put them miles and miles apart - it makes them very difficult to find.
  • Could your "Log Out" button be handled in the event structure, and then use that to close the VI? Or does it need to be after the EvStr like that? This prevents logging out without taking an action or invoking the timeout - which actually does nothing. So you could drop the timeout and move the log-out inside, by my guess.
  • Likewise you don't need a separate case structure for the Sends, you could put them in the RF_Path Value Change event case since that's the only time they happen (due to the true value).
  • Moving RF_Path inside the value change event allows you to use a Latching behaviour if you'd prefer that. See Changing the Mechanical Action of a Boolean Object 
  • As altenbach already pointed out, you have lots of local variables even whilst their controls are unwired. You can simply move the control to the location of the Local Variable and remove the local variable, optionally hiding the control if desired.
  • Of course, if you really don't want the values to be changed - just set a block diagram constant instead!
  • When adding elements to the end of an array, using Build Array set to Concatenate instead of Array Size and Insert into Array. The same can be done for placing elements at the beginning of an array (drag the Build Array upwards instead of downwards, or just wire the array to the bottom instead of the top input).
  • For two very similar packet structures, you're actually only changing one value. So you could remove one copy of code and just handle the changes.

Re: max unable to see ni 9870 or 1

$
0
0

The link in your answer  doesn't work

Re: Club two packet structure along with data and send separately

$
0
0

Here's a tidied version that should be almost exactly equivalent.

 

It might be easier to work from this version if you agree it is the same.

The attached VI is backsaved to 2014 (seemed to be the source version).

The snippet is saved with 2019 so incompatible.

adding packets_BD.png

 

I'm pretty confused about the intention with the For loop - perhaps this is intended to be used to send separate packets?

In which case you might (instead of placing them all in one array) create two separate arrays of your headers + data blocks (DA1 and DA2 as two separate array structures) then call UDP Write twice as was described.

Re: Turn on Scripting programatically

$
0
0

There is

server.viscripting.showScriptingOperationsInEditor=True

in the LabVIEW ini file.

Re: Reading 12 daq cards with 16 channel each

$
0
0

1. I'm using the FIFO overflow output to monitor the RT FIFO so far no overflow error has been detected 🙂 Anyhow I'll move the conversion to consumer loop, thanks. 

2. Never heard of that, I'll  read about this.

4. Yes indeed, just didn't have the time to fill all the detalis. After all we are talking about Producer/Consumer concept here 🙂


Re: GNU C & C++ Compile Tools for ARMv7 (Linux 2018-2019)????

$
0
0

Re: Set number of major ticks to a predefined value in a WaveForm Graph

$
0
0

Ok. Now I've understand all.

Your solution works fine !

Thanks

Re: Club two packet structure along with data and send separately

$
0
0

 wrote:

Yes I can use multiple UDP's but I want to send the data on a particular port only. Doesn't it create a conflict when I use multiple UDP write with a same port number?


UDP is a connectionless protocol and you can use a connection ID to connect to as many other devices and ports in any order you want. The connection ID basically just defined the local source port. Why would that create a conflict?

 

To send two different messages you can use two instances ot UDP send, or just use a FOR loop:

 

altenbach_0-1584207680549.png

 

Your questions and your attached code tells me that you are not really ready for this entire project. I strongly recommend to start again with LabVIEW and networking tutorials. I hope you are just doing this just as a hobby. Especially focus on LabVIEW array operations.

 

We might be able to help more if you describe in simple terms what you want to to and what the message structure is. I am sure it can be done with code the size of half a postcard if done right. This is a simple problem and does not need or deserve such complicated code.

 

  • Are you just sending out or are you also expecting replies from the other UDP devices?
  • Are the message always the same size and with the same structure?
  • What is receiving these messages? Generic third-party devices or a LabVIEW program under your control?
  • If this is a third party device, is there a manual describing the expected message?
  • ...?

 

Re: Nyquist criterion was ot be fulfilled

$
0
0

 wrote:

I used NI 9201 as my DAQ card to read my piezoelectric sensor (unimorph). my cut off frequency is supposed to be 500 HZ but could not insert the value in the filter (as it already mentioned that it has default only 400 HZ). and it keep appearing in my filter that " the current filter specifications do not meet the Nyquist criterion for the given input signal" . How do i solve this problem and is there any mistake with my procedure?


  1. You should start a new thread.
  2. I don't use DAQ Assistant and have no idea how it transfers to another computer, but when I open it, it says the sample rate is 500Sa/s.
  3. For that rate Nyquist is 250 Hz.
  4. You cannot set your low-pass to 250 Hz, it needs to be less then Nyquist, so the max would be 249.99... I think you are better off setting it to 200 Hz.

mcduff

Re: Simple State Machine template to build a simple calculator

$
0
0

Your requirements are much simpler than needed for a "state machine". You really don't require one! You just have two numeric inputs, a mode selector (enum with four items), and a result display. Whenever any of the controls change, the result needs to be recalculated. There are no "states" that need to be communicated across iterations, for example. You can do it polling or using an event structure.

 

If your teacher wants a "state machine", maybe it should be explained why. Seems to just complicate things unnecessarily... 😉

Viewing all 204074 articles
Browse latest View live


Latest Images

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