MVP 2022 Joe Tauser Posted April 3, 2019 MVP 2022 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 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted April 3, 2019 MVP 2022 Report Share Posted April 3, 2019 Nice work, Joe. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.