From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Various data type conversions

I am working on designing a digital controller to drive a real time target. I need to use an observer and am having nothing but problems with incomparable data types. I look in the numeric >> conversion pallet but nothing seems relevant to my particular case. Any ideas? Am admittedly relatively new to LabVIEW in general. This is the first time I have attempted to use CD Ackerman, CD Construct State Space and the DT Observer.

 

Please see screenshots and VI.This is a SISO system with 3 states.

 

Thanks for any help.

Download All
0 Kudos
Message 1 of 8
(1,546 Views)

Hi jjk,

 

you need to learn about using/handling arrays in LabVIEW!

Your subVIs expect arrays of various dimensions (1D, 2D)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(1,543 Views)

I must confess I know little of the specifics of the equipment and system you are using, however, to me it seems like it could be a relatively simple fix. I opened your vi and was able to fix the incompatibility using the Build Array function. Now, again, I'm not sure exactly what you are attempting here but speaking just to the simple conversion in adding a dimension, I used the Build Array function with one input and one output. You could also potentially use an inner for loop to populate an array with the same input value (e.g. ref) for a specified number of iterations using indexing if you have the info available. I would attempt what I have suggested in a test and see if it gives you expected results. Or if any body else is reading this and disagrees feel free to reply to my reply and correct me.

Thanks, and good luck

0 Kudos
Message 3 of 8
(1,462 Views)

@IzzyPrice wrote:

I must confess I know little of the specifics of the equipment and system you are using, however, to me it seems like it could be a relatively simple fix. I opened your vi and was able to fix the incompatibility using the Build Array function. Now, again, I'm not sure exactly what you are attempting here but speaking just to the simple conversion in adding a dimension, I used the Build Array function with one input and one output. You could also potentially use an inner for loop to populate an array with the same input value (e.g. ref) for a specified number of iterations using indexing if you have the info available. I would attempt what I have suggested in a test and see if it gives you expected results. Or if any body else is reading this and disagrees feel free to reply to my reply and correct me.

Thanks, and good luck


Your reply is too ambiguous to tell if it is correct or not. We prefer to see graphical code.

0 Kudos
Message 4 of 8
(1,454 Views)

Hi altenbach,

Thank you for your feedback. I have attached the vi with my modifications (however I lacked a few of the packages to load everything in the vi). I'm probably thinking too simply for this to work but I thought I'd give it a go as it's my first foray into the LabVIEW community. I also realize my for loop comment wouldn't work now that I revisit it so ignore that.

Thanks,

Izzy

0 Kudos
Message 5 of 8
(1,444 Views)

Oops, sorry, somehow I managed to reply with someone else's account and can't seem to delete the reply so please refer to dpnsw for the reply. Thanks

0 Kudos
Message 6 of 8
(1,436 Views)

Hi Izzy, 

 

I thank you for your advice and time. Your suggestion did not seem to work well for the gain; however, it appears to have worked for the output signal from the encoder. I found that using CD Pole Placement instead of CD Ackerman gave me the correct data type for the gain. The gains found in LabVIEW match what I calculated using MATLAB so I am happy with this aspect. I am still having an issue with the observer because it does not output a state estimate. I am not yet sure if this is because of the data conversion used on the signal from the encoder or if it is because of something else. I am still trying to find the source of this error. I included my VI if you want to take a look.

 

Thanks again for your help.

0 Kudos
Message 7 of 8
(1,383 Views)

Hi JJK1503,

 

I'd love to be of any assistance unfortunately I have little to no experience in what you are actually doing and could only really speak to isolated data type conversions and am still not sure if my advice was accurate in this context. Hopefully maybe someone else with more experience can give you better feedback.

 

Thanks, and good luck with your application.

Izzy

0 Kudos
Message 8 of 8
(1,349 Views)