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

Re: Labview I/O Server

$
0
0

MattBHGE_0-1582149839953.png

MattBHGE_1-1582150033821.png

 

These are the values I'm trying to read.  I rewrote the code using NI modbus library.  I am getting values but they are not the values I want.  They are the Uint16 values and I need the floating 32 values.  I am having no luck converting them from 16 to 32.  Is there any simple code that can run to convert those values?


Re: Real-time updating '1D array double' data converting to periodically updating 'double'

$
0
0

You didn't include the VI that you are passing the data into. Therefore, we have no idea what type of data that VI is expecting as an input. You should zip up all of the related files and attach that.

How to convert PDU to Modbus Library's holding register U16

$
0
0

I have set of PDU specs by schneider electric motionstage, it's configured to communicate following Modbus TCP.  I am new to modbus library, but my understanding is that for the PDU I'd like to write (see attach), the modbus library master example set holding register will provide function code 0x10, I will need to set the start writing address to be 0x0043 (decimal 43), which will be part of the  PDU constructor to build final PDU

 

So, I convert the rest of byte array 00 02 04 208(D0) 00 00 07 with the utility function (Bytes to U16) to 2 1232 0 (https://github.com/NISystemsEngineering/LabVIEW-Modbus-API/tree/master/Utility) , which seems incorrect, because the reverse conversion (U16 to U8) is not correct -> 00 02 04 208 00 00 (missing 7)

 

How should I correctly set my PDU at the holding register via Modbus Library? (As I am now, disregard I set the holding register as 2 1232 0 or 2 1232 7, I am getting error 538183 (Invalid value)  

 

Re: Real-time updating '1D array double' data converting to periodically updating 'double'

$
0
0

Here are the missing VIs. Also, the VI is expecting a cluster of 15 inputs being 5 unsigned word, 5 doubles and 5 booleans.

Re: How do I uninstall Labview 2018 Continuous Integration System

$
0
0

Thanks ! I removed the LabVIEW_CIS_PKG_180001 from ProgramData\National Instruments\License Manager\Licenses

and the nagging window went away! huge relief. Thanks!!

How to detect a signal from camera

$
0
0

Hi

 

Is there any way to track whether a camera receive a trigger signal?

 

I am trying to implement the following routine:

 

The camera starts with "trigger off" mode and is taking images through a grab loop. When an external device send the trigger signal to the camera, the camera switches to "trigger on" mode and then starts to run with the external device simultaneously. 

Medir RPM con sensor de herradura y DAQ

$
0
0

 Buenas tardes, alguien que me pueda ayudar a hacer una programacipn para medir los Rpm de un motor con un sensor de herradura el ITR 8102 y una NI myDAQ x, ya hice varias programación y nomas no me funciona, espero su respuesta, gracias. 

 

Re: Real-time updating '1D array double' data converting to periodically updating 'double'

$
0
0

You already have the data you need to pass to the subVI. Instead of wiring the array, wire the corresponding calculated percentage that you are wiring into the indicators on your front panel. BTW, the code is failry messy and I would never put unlabeled controls or indicators on the block diagram. You have free floating text over the indicators on the front panel but your actual indicator values are empty. Controls and indicators have both a label and a caption. Use those. This helps to document your code. In addition, I would not use the bundle operation but bundle by name instead. Again, this makes you code more readable. Bundle by name does require a cluster, preferably a typedef, input so you know what the cluster contains and what the element names are. Since you are using a third party library and it is not likely to change you can simply create a constant from the input to Write Composer Gas Mix vi and use that as the input to the bundle by name. Another benefit of doing this is that you don't have to wire the unused elements of the cluster. Simply make sure they have the correct value in the cluster constant.


Re: Nipcibrd.sys/ Labview 2019

Re: Serial VISA buffer overrun

$
0
0

 wrote:

Yeah I wish this was better, but to get full resolution pictures or even snippets to work, you have to right click then "View image" then edit the URL to remove "/image-size/medium?v=[stuff]". Basically, remove "image-size" to the end of the URL, and you can see it full size.

 

Hopefully this link works:

 

/t5/image/serverpage/image-id/262570iA04CB11E994C4508/

 


My browser has the option for "full screen".  I have a standard 1080p monitor and it hasn't failed to display a full-sized picture (yet).

Re: How to convert PDU to Modbus Library's holding register U16

$
0
0

Why are you calling the low level VIs of the Modbus library? Simply call the appropriate method, most likely "Write Multiple Holding Registers" with the correct register address and data. Let the library build and parse the PDUs.

Re: How to convert PDU to Modbus Library's holding register U16

$
0
0

In my PDU example, what would be the U16 holding register value be ? I called the low-level utility to check what the U16 value is supposed to be..

Re: Real-time updating '1D array double' data converting to periodically updating 'double'

$
0
0

I was in the middle of trying new things out, which made organization worse (I am also very new to LabVIEW). Thank you so much for your time to explain it clearly and solving my issue. 

 

One more potential issue is that my 3rd party subVI needs the three percentages to equal exactly 100. Since I am taking the 3rd gas as (100 - (gas1+gas2), would it be perfectly 100 all the time? (wondering about significant digits of doubles)

Lastly in terms of organization, is there any other tips/recommendations to make the wiring nicer? I tried ctrl+u to automatically clean up wires but it isn't properly organizing the wires.

Re: Condition input to "db tools update data.vi"

$
0
0

I dropped the quotes and no longer get any errors, but it changes all of the rows, only 5 fortunately, in the DB.

Re: Eliminate the need to recompile a executable if a vi is changed at source

$
0
0

Thank you guys,

I will dig deeper on we are calling the VI's in our executable and if I need more help I will post it here.


Re: Real-time updating '1D array double' data converting to periodically updating 'double'

$
0
0

First and for most I would avoid using the express VIs. Learn the DAQ primitives and use those. Express VIs tend to reinitialize the DAQ task every time and this will cause a performance issue. I can't really comment on whether your percentages will always equal 100 or how your third party library will deal with that. When working with floating point values you should never rely on testing equality but rather test using a tolerance. Because as you stated, digits of precision can come into play.

 

Regarding some basic tips for clean code, here are a few basic guidelines:

Keep your wire flow going left to right

Avoid wire bends as much as you can

Don't run wires backwards

Keep your block diagram small, it should not be larger than a single display. Smaller is not bad since it will accommodate laptops.

Use subVIs. Especially if you find yourself copying and pasting code on your diagram.

Label things

Take some time to learn some of the various architectures (basic: state machines and producer/consumer; advanced: queued message handler, actor framework)

 

There is an older book by Peter Blume but it is still very informative:  LabVIEW Style Book 

Re: Call library function node with dynamic memory

$
0
0

George already told you what you should have done. The main fault (the rest are more beauty mistakes) is that you declare the function to take an array of ints as parameter. An int used to be 16 bit under DOS but that is 30 years ago. It’s since on almost all platforms a 32 bit number. In LabVIEW you however configure the parameter to be an array of bytes (8 bit). The C code does what you told it, it treats the array as int32 values filling in your first number into the first four bytes and the second number into the next 4 bytes. LabVIEW also does what you told it to do, it allocates an array of 10 int32 values but coerces them to an array of 10 8 bit values as you told it in the CLN configuration that the array is supposed to be of 8 bit numbers.

You were lucky that you didn’t attempt to assign a 3rd number to the array because LabVIEW passes in a memory buffer of 10 bytes but your third variable would try to write to byte 9 to 12 and bummmm 💥. Either the CLN returns a 1097 error, which indicates there was some memory corruption or similar going on (but ignoring that error is baaaaaad) or Windows shuts down LabVIEW immediately as it detected that something bad was going on! Either way you are in trouble! It could also be that neither can detect that something went bad, which is the most nasty situation for you. The memory corruption happened anyhow and something went corrupt but you only will find out (sometimes much) later when some unrelated code section crashes on you!

Re: Condition input to "db tools update data.vi"

$
0
0

Did the 5 rows all have the same ID? IF so, it did what you asked. If not, then something would appear to be wrong with the WHERE clause. To be honest, I rarely use most of the VIs in the DB toolkit. I generally only use Open, Close, Execute, and Fetch. My applications include the actual SQL in the code. As a rule of thumb, I generally only use stored procedures in the DB. This provides a nice API to the DB and allows changes to the schema without requiring changes to the application provided I maintain the calling structure of the stored procedures.

Re: Variant to Data Object "memory"

$
0
0

This issue will be fixed in LV 2020.

Re: How to convert PDU to Modbus Library's holding register U16

$
0
0

Without seeing the spec for your specific device, it is difficult to say what your data values should look like. However, the Modbus library is 0 based for it's addressing, so to start writing at address 43, you would actually wire 42 to the starting address input of the Write Multiple Holding Registers vi. The content of the U16 array for the data is dependent on the specific device. Their documentation should let you know what the data should look like.

Viewing all 203894 articles
Browse latest View live


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