Siemens S7 200 - Math question

Preeya

Member
Join Date
Nov 2003
Posts
112
Hi everyone,

It looks like it is not possible in Siemens Step7/MicroWin32 to divide an INT with a DINT? I need to divide 60000 with an integer and it gives me an error if I use DIV instruction. So I converted the INT to DINT and used DIV_DI. It did not give me an error but I am not sure if there is any other way.

In RSlogix I just use the DIV and specified any data type.

Also how do I specify unsigned and signed integers? By default it takes it as signed integer.

Thanks
 
You have to use DIV_DW it assumes you are using Double Words on all "Handles". If you want to use an INT, it will have to be moved to a DINT to use it. There are times when someone may want to divide a negative value. The difference in pos or neg is the MSB (most significant Bit). It it is a 1 then the value will be negative.
 

Similar Topics

commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
1
Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
97
Hi Experts, I would like to make firmware upgrade from v3.0 to v4.5 (S7-1200 CPU 1215C). Can I do it from v3.0 to v4.5? Do I need to take some...
Replies
6
Views
179
Hi Guys, I am trying to establish communication over profinet between Siemens S7-1200 PLC as IO device and codesys plc as IO controller. But I am...
Replies
39
Views
2,076
Which signals do I have to use to get data from camera. For example camera detects a defect and sends signal to controller. Power cable: CCB-PWRIO-05
Replies
1
Views
161
Back
Top Bottom