MVP 2023 Joe Tauser Posted April 3, 2019 MVP 2023 Report Share Posted April 3, 2019 I have found the Vect. Linearization block most useful in Visilogic for dealing with applications involving temperature. For example, how do you get rid of that pesky decimal point on a whole thermocouple module in one fell swoop? Here's how- So when I'm translating this application to UniStream I discover this block is missing. The Help on the UniLogic describes how an array can be passed as a parameter, but it doesn't mention that only one element of the array can be passed. I spent a fair amount of time trying to specify my thermocouple structure as the input argument to the Linearize block to no avail and eventually contacted support. No, you can't pass a whole array. So having learned my lesson from the PWM block I went looking in the examples. Sure enough, one of the Creators had wisely made an example app containing the "Linearize Array" UDFB, which is set up to handle a 16 element array. Make sure all your variable structures and data types match when you're using any UDFB. On top of removing the decimal, my customer made the totally unreasonable request of being able to convert all the temperatures from F to C from a button on the screen. Fahrenheit rules the world! No, wait a minute, it doesn't. Anyway, here's what I came up with using the UDFB- Remove the decimal. Notice that the convert F to C block does it automatically- Now the first time I did this, I realized that all the user setpoints were still in the units entered. So we have to convert all those, too. I do like how the input parameters are easily recognizable and editable using the UDFB. And good times where had by all. Joe T. Linearize Array.ulle 1 Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted April 3, 2019 MVP 2023 Report Share Posted April 3, 2019 Nice work, Joe. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now