Ben C Posted September 13, 2023 Report Posted September 13, 2023 Hello all. I've recently started using Visilogic PLC's and Unitronics equipment as a complete novice with no more than "some" common sense and a bit of background computer knowledge. So far I have managed to complete simple tasks (HMI , jumps , buttons , basic linearization, HW config) on the project I am currently working on, however I am having some issues with some more advanced functions, in particular logic functions and some maths functions. i have a 0-10v vacuum transducer which is set in the hardware configurator as a 10-bit(fast) analogue input, i would like to make this to read in scientific notation such as X.XXe^X Mbar values is there a recommended way to try and approach this or is there a function block similar to the linearization FB i can use? any help or guidance on this would be greatly appreciated many thanks, Ben
MVP 2023 Ausman Posted September 13, 2023 MVP 2023 Report Posted September 13, 2023 Welcome Ben, highly relevant to your question is the need to know what model Vision you have?
Ben C Posted September 14, 2023 Author Report Posted September 14, 2023 9 hours ago, Ausman said: Welcome Ben, highly relevant to your question is the need to know what model Vision you have? Morning thank you! , apologies i read the DO's and DON'TS after i had posted this. i am using a V1040-T20B with an IO-AI8 for the analogue input in question. is there any more information you need?
DanT Posted September 14, 2023 Report Posted September 14, 2023 Hi; 0-10V Analog Input - the PLC takes the raw analog data and stores it in an integer ( MI) in the PLC memory. If you are planning to do math with the number, then work in integers - a lot faster and easier for the PLC to process, you just have to keep track of the decimal position. MI's are 16 Bit nimbers -32000 to +32000 roughly, or use an ML 32 bit numbers Scientific notation ( Floats ) requires a lot more PLC processing time because everything has to be converted into interger math anyways by the processor during the process. Displaying Integers with decimal point is easy as you know where it is and can tell the Number display how to display the number with the decimal. ( displaying floats is a bit more tricky as you have to display it as a string, not a number - more plc processing time.) Floats eat up PLC Scan time -- cause it to be longer, Integer Math is faster and natural to the PLC Processor. DanT
Ben C Posted September 15, 2023 Author Report Posted September 15, 2023 18 hours ago, DanT said: Hi; 0-10V Analog Input - the PLC takes the raw analog data and stores it in an integer ( MI) in the PLC memory. If you are planning to do math with the number, then work in integers - a lot faster and easier for the PLC to process, you just have to keep track of the decimal position. MI's are 16 Bit nimbers -32000 to +32000 roughly, or use an ML 32 bit numbers Scientific notation ( Floats ) requires a lot more PLC processing time because everything has to be converted into interger math anyways by the processor during the process. Displaying Integers with decimal point is easy as you know where it is and can tell the Number display how to display the number with the decimal. ( displaying floats is a bit more tricky as you have to display it as a string, not a number - more plc processing time.) Floats eat up PLC Scan time -- cause it to be longer, Integer Math is faster and natural to the PLC Processor. DanT Good Morning Dan, thanks for your explanation on this, unfortunately my hands are tied in terms of using scientific notation for vacuum measurements on this project. BenC
MVP 2023 Flex727 Posted September 15, 2023 MVP 2023 Report Posted September 15, 2023 5 hours ago, Ben C said: my hands are tied in terms of using scientific notation for vacuum measurements on this project There isn't much flexibility in the way Real numbers can be presented on the HMI screen, therefore you are likely going to have to brute force it. It should be a fun and challenging experience.
MVP 2023 Joe Tauser Posted September 15, 2023 MVP 2023 Report Posted September 15, 2023 On 9/13/2023 at 9:54 AM, Ben C said: i have a 0-10v vacuum transducer which is set in the hardware configurator as a 10-bit(fast) analogue input, From the IO-AI8 datasheet, Fast Mode mode is 12 bit. That will make a significant difference in your scaling - 4096 counts vs 1024 counts. What are your expected range of values? First do your scaling in integers as everyone recommends to get your base number with an implied decimal. If your heart (or boss) is truly set on this presentation you'll have to build and display a string to get the visual format you want. Even if you use floats, you can't guarantee that the exponent will appear as the PLC will display it as a regular decimal if it can. Joe T.
MVP 2023 Ausman Posted September 15, 2023 MVP 2023 Report Posted September 15, 2023 I have never had to do this, but can't see any real issues that can't be done via maths and manipulation of numbers as everyone has already said. The other question is how do you want it to actually show? Will it be as simple as 6.8 - 03- or something more complex? As mentioned by others, you will have to take a few steps to achieve the result, which will end up as either a string or number being displayed on the screen, possibly with other smaller notations accompanying the main "number" to make it look the way you want. Joe's question re range you want is very relevant. As well, have you actually considered what your transducer can actually do in working with the PLC? If it is running 0 as absolute vac, and 10v as "atmospheric", your range of of 4096 via the plc is actually only going to be able to show something like .25mbar at an input reading of 1. Which actually isn't that low a vacuum. cheers, Aus
MVP 2023 Joe Tauser Posted September 15, 2023 MVP 2023 Report Posted September 15, 2023 To expand on Ausman's comments- This application got stuck in the back of my head for some reason and I noodled some more on it. It might have something to do with my antique radio restoration hobby and the videos I've watched of guys making their own vacuum tubes (valves). First off, I wouldn't recommend Fast Mode. Everybody thinks they need to go "fast". I don't see your system changing it's vacuum every 25 ms and the 100 ms response in normal mode is probably fine - It's your choice, but you will get four more times the resolution on your transducer in Normal Mode. You haven't told us the range of your transducer but you have told us you want to display exponents, so I'm guessing you're trying to pull a deep vacuum with a diffusion pump or something like that. Let's say you have one of these OMG sensors - https://schoonoverinc.com/wp-content/uploads/2016/12/Vacuum-Sensors.pdf We'll pick the Penningvac PTR 225 N / PTR 237 N that goes from 1x10^-8 to 5x10^-3 mbar. Converted to numerical representation, that's a range of 0.005 to 0.00000001 mbar. Normalize that to integers with a virtual decimal point at 1x10^-8. So your range is 500,000 to 1. Definitely scale with MLs. Now - using the input in Normal Mode your signal can be sliced into 16,384 pieces. Each count of the A/D converter equals 3.1x10^-7 mbar, which would probably be unacceptable. But let's say I'm wrong here and your range is realistic. You can use a series of divide blocks to extract the scaled actual value into its multiplier and exponent components. Then you can display two numbers next to each other so they look like one: This would probably be easier that trying to create a text string. This is what I do for fun on a Friday night. Joe T.
MVP 2023 Flex727 Posted September 16, 2023 MVP 2023 Report Posted September 16, 2023 16 hours ago, Joe Tauser said: First off, I wouldn't recommend Fast Mode. Everybody thinks they need to go "fast". I don't see your system changing it's vacuum every 25 ms and the 100 ms response in normal mode is probably fine Resolution is almost always more important than speed, but it's important to evaluate the physical properties of the sensor as it relates to the system as a whole. The system's response to the input, whether it's a heating element, pump, or other action, is key to determining needed speed of the input. It seems to me that very few PLC programmers nowadays understand the controls engineering aspect of their software.
Ben C Posted September 18, 2023 Author Report Posted September 18, 2023 Hello All, Thank you for your comments. i'm going to try and answer questions as best i can: the sensor i will be using is an Edwards Vacuum APG200M which i believe has an operating range of 1.8-9.2V , from previous experience calibrating these i believe this will have to be a linear performance curve. Joe: nothing as fancy as deep vacuum , this will be from atmospheric to rough/medium vacuum with a range of ATM to about 5x10-4mbar i agree with changing from fast to normal mode to get more resolution and the speed different will be negligible. thank you for your explanation for the thought process , this has so far been the most daunting aspect this so far ausman: you are correct in your reply about it being as just a reading of 6.8 - 03 etc. flex727: hopefully this is a good habit i will be able to pick up from the more experienced gents and ladies on here as there is a great deal of knowledge available on this forum and everyone has been very helpful so far! thank you all for your time! BenC
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