11-18-2024 04:27 AM
I would like to replicate 2 functions I use within SIemens TIA Portal regarding scaling
Normalise and Scale
I have an analog input, 0 to10V giving me 0 to 32767 - I would like this to give me a range of -20 to +80
Can anyone please suggest a way, Thank you
11-18-2024 04:41 AM - edited 11-18-2024 04:43 AM
Hi Lee,
@LeeBowers1 wrote:
I would like to replicate 2 functions I use within SIemens TIA Portal regarding scaling
Normalise and Scale
I have an analog input, 0 to10V giving me 0 to 32767 - I would like this to give me a range of -20 to +80
Generic math with function of 1st order:
y := a*x + b
You just need to determine the correct values for a & b to scale your input x (0…32767) to the desired output y (-20…+80)!
Hint:
b = -20
a = (y range) / (x range) = (80 - -20) / (32767 - 0) = 100 / 32767
How do you transfer the PLC raw data into your LabVIEW VI?
Do you even use a PLC or do you use a (NI) DAQ device?
With DAQmx you can even apply scaling (by ranges) to your AI channels, there's no need to determine a&b in this case!
11-18-2024 05:58 AM
Hello GerdW
Thank you for your email.
Your reply makes sense to me and it did seem more like a maths question rather than LabVIEW.
I did in in the interim ask chatGPT and it came back with a similar response as yourself.
Thank you
Lee
11-18-2024 02:55 PM
@LeeBowers1 wrote:
Hello GerdW
I did in in the interim ask chatGPT and it came back with a similar response as yourself.
Thank you
Lee
I knew it! GerdW is AI. That explains a lot. 🤔
11-18-2024 04:11 PM
@NIquist wrote:
@LeeBowers1 wrote:
Hello GerdW
I did in in the interim ask chatGPT and it came back with a similar response as yourself.
Thank you
Lee
I knew it! GerdW is AI. That explains a lot. 🤔
That's quite an insult. "AI" is misnamed; it should be called 'Artificial Stupidity'.