LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scaling

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

0 Kudos
Message 1 of 5
(115 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(110 Views)

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

0 Kudos
Message 3 of 5
(86 Views)

@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.  🤔

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 5
(35 Views)

@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'.

0 Kudos
Message 5 of 5
(23 Views)