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

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
95
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,055
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
160
Hi First post here! I admit I am not too used to handle interrupt OBs in Siemens. I have a customer who has been buying a standardized solution...
Replies
4
Views
210
Back
Top Bottom