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

Re: RT TCP Write sometimes does not

$
0
0

Rather than use simple TCP for my LabVIEW RT Project, I used Network Streams.  My data rates are comparable to yours -- I'm sending 16-24 channels of I16 data at 1KHz, sending 50 samples at a time (or 20 times a second).  One of the channels being sent is a "clock" channel to ensure I don't lose any packets, and they all come through fine.

 

Bob Schor


Re: Problem with intensity graph

$
0
0

There is a difference between "blank" and black".

 

So let's first look at the code:

  • The upper FOR loop can be removed and you can use string to byte array to replace the entire thing (or case to an array of U8)
  • You have plenty of race conditions due to overuse of local variables, but it's hard to tell, because you apparently chopped up the real VI so we can't really tell. For example the "data array" gets initiaized while you read from a local variable elsewhere. There is no way to tell what happens first, but the result will depend on the order.. You are using x and y for both the current scan position and for the size determination.
  • In the second loop, you are replacing the same element position over and over until you run out of element on the blue array and when the loop stops, all you get is the last replacement Shoudn't you have a new xy for each element? Of you are replacing an entire row (or column), you would only need one index and no loop.
  • Are the x and y values in units of pixels?

Sorry, it is completely unclear what you are doing, but it does not look right at all. All you need is a feedback node globally initialized with the full sized array, they you would do a replacement for each xyz set. No need for local variables.

 

Maybe this recent post can give you some ideas.

Re: USRP 2955 Not Receiving Signal

$
0
0

Try the niUSRP EX Rx Multiple Inputs (Single Device, Multi Channel) example and see if that works for you. When you say you edit the front end do you mean you change some of the values on the front panel or are you modifying the example code?

 

Can you send a picture of your hardware setup? I want to check to see if your configuration matches your wiring.

 

Cheers,

Michael

Re: Problem with intensity graph

$
0
0

I am very sorry if I was not clear. I called the intensity graph blank as it gave me the same intensity graph before starting the program and thus I called it blank.

 

There is a program which will change the X and Y values every time for each element in a certain order in accordance to the mpvement of the scanner. I placed the local variables as the actual varaibles are actually very far apart from this part of the program and connecting them by a line would make the whole program very messy and confusing. 

 

The X and Y units are in mm.

 

Does this help? I will take a look at the link that placed!

 

Re: chart

$
0
0

Did you look in the example finder? 

Re: Send array of numbers through serial port - Write VISA

$
0
0

i have a problem in my code 
i want to send numeric array contain of 500*10^3 element when i send i have error message memory is full
i want a way to make asynchronous 
and send this array by use USB to TTL

Re: Problem with intensity graph

$
0
0

I actually did the same things that you have posted in the link with the shift registers but changed it as someone recommended that I use a local variable so I changed my program. It still gave me the same result when dealing with big values. 

Re: How to achieve high speed data transfer through tcp?

$
0
0

 wrote:

I must confess I always get confused by Ethernet speed specifications.  I know we have 100BaseT drops in our labs, with an option to have a Gigabit Drop (if we pay extra), but is that 100 million bits or 100 million bytes?


The specs on the actual ports is in bits.  Also keep in mind that those ratings are for the actual bus.  The TCP/IP headers are not counted in there.  So that will cut down on the transfer speed as well.  Jumbo Packets can help that out.  Or you could go with UDP, which has less overhead but you lose guaranteeing the data gets there.

 


 wrote:
(hmm, what's the rating on this laptop of mine, about two years old?

For an Ethernet port, it is most likely 1Gb/s.  Gigabit Ethernet has been around for quite a while now and it is hard to find cards that are actually 100MB/s.  The standard allows for backwards compatibility, so there is no real reason (not even cost) to not go with the Gigabit.  Some routers and switches you need to be careful of though.


Re: waint until ms vs ms function

$
0
0

In less words than Bob...

 

Wait Until Next ms Multiple is used for synchronization.

Wait ms is used for general waits.

 

Let's just say one of these functions gets called with a timer value of 90 and it is set to wait for 100ms.  The Wait Until Next ms Multiple will actually only wait 10ms since 100 is the next multiple of 100.  The Wait ms will actually wait for 100 ms, ending with a timer value of 190.

Re: RT TCP Write sometimes does not

$
0
0

 wrote:

Rather than use simple TCP for my LabVIEW RT Project, I used Network Streams.


Those are not compatible with a C# application.

Rif.: Temperature to unsigned

$
0
0

Your "Value in" contain a high 14th bit which is spurious (real value is 13 bit wide, as you state). If we mask this bit (or equivalently subtract 8192 from Value in), we still get the correct temperature, moreover it is possible to reverse the formula dividing by 128 first and then right-shifting 3 times (equivalent to binary division by 8), like in the attached example.

 

Re: chart

$
0
0

From the LabVIEW help:

Customizing Graphs and Charts

  • Strip Chart—Shows running data continuously scrolling from left to right across the chart with old data on the left and new data on the right. A strip chart is similar to a paper tape strip chart recorder. Strip Chart is the default update mode.
  • Scope Chart—Shows one item of data, such as a pulse or wave, scrolling partway across the chart from left to right. For each new value, the chart plots the value to the right of the last value. When the plot reaches the right border of the plotting area, LabVIEW erases the plot and begins plotting again from the left border. The retracing display of a scope chart is similar to an oscilloscope.
  • Sweep Chart—Works similarly to a scope chart except it shows the old data on the right and the new data on the left separated by a vertical line. LabVIEW does not erase the plot in a sweep chart when the plot reaches the right border of the plotting area. A sweep chart is similar to an EKG display.

Re: USRP 2955 Not Receiving Signal

$
0
0

Thank you Michael!

 

I tried the example you suggested. At first it didn't work, but then I removed the attenuator on my sma cable. There is screen shot (2920to2955-MultiChan.png) of the tx (2920) and rx (2955) front panels.

To answer your questions, by "front end" I meant the VI front panel, sorry for the confusion. I included a picture of my hardware setup (hardware-2920to2955.jpg), which shows the attenuator, if you're still interested.

 

I'm still not sure why the 2955 device wasn't working with the other example; more importantly, the 2955 wasn't receiving anything when using my team developed VI for a GNSS receiver. I hope to use niUSRP EX Rx Multiple Inputs (Single Device, Multi Channel).vi to make appropriate adjustments to my project. I will post updates here for anyone viewing this thread with similar issues.

 

Thank you again Michael!

 

Re: Temperature to unsigned

$
0
0

One problem is that (as noted) there seem to be extra "stuck bits" in the original example.  Your code notes that this acts as a 13-bit 2's complement binary.  13 bits means that the "real" values that matter to us are in the range of 0 .. 8191, so a value of 12288 (representing -256) is outside this range, having bit 13 (8192) "stuck" on -- the "real" (unsigned) number is 4096, or 2^12.  To get its signed value, we need to "extend the sign bit" (bit 12) -- the easiest way to do this is to test if the number is >= 4096 (i.e. has the sign bit set) and "extend" it by subtracting 2^13 (8192).

 

The "forward" algorithm thus is this:

Forward Temp.png

Inverting this is straight-forward, except for handling the apparently "stuck" bit 13, which we can do at the very end:

Backward Temp.png

The "false" cases above are just straight-through wires.

 

Wow, it's been a long time since I dealt with "offset-binary" and two's complement numbers.

 

Bob Schor

Re: Writing Data to Excel File without Report Generation Toolkit

$
0
0

Do you really need to write an Excel (.xlsx) file?  Would a SpreadSheet file (a Comma-separate-value, or .csv) file that Excel can open and treat as a SpreadSheet, work for you?  If so, use Write Delimited Spreadsheet.

 

Bob Schor


Re: Creating a Test Program

$
0
0

Queued State Machine is a more robust architecture but also requires more time developing it. My first proposal keeps it simple but scalable solution.

 

Greetings!!!

Extract string at a specified character

$
0
0

Hi all,

I have a string like this

abcd012-_20180601_103629.csv

I want to extract only the part before the first underscore ("abcd012-"). 

Can someone help me with this?

Thank you,

MV

 

 

Re: VFD communication Modbus RTU by RS-485

$
0
0

This looks very promising, Thank you! I will try it ASAP and let you know whether or not it worked. I am fairly confident that this MODBUS palette route is the way to go so I am very hopeful that this works or that it puts me on the right track.

Re: Cannot get latch mechanical action on boolean button inside a cluster

$
0
0

 

Sorry, I didn't quite "get" your original question.  Are you trying to use your Cluster inside an Event Structure, and have it "fire" when any of the Buttons is pressed?  That's trivial and certainly does work, as evidenced by this code:

Latching Cluster.png

 

Here, Buttons is a Cluster with an OK, a Cancel, and a Stop (all "Latch when Released") controls.  When you push one Control, it "fires" and returns (in New Val) the Control that fired, resetting them all to Off.  Both the outputs Buttons 2 and NewVal will show the Control that was pressed.

 

Bob Schor

Re: waint until ms vs ms function

$
0
0

BS for verbosity, crossrulz for succinctity (is there such a word?).

 

BS

Viewing all 204112 articles
Browse latest View live


Latest Images

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