PLC 16 in / 8 rev / an in-out / CAN
Dependencies: PCAL955x mbed mbed-rtos AT45
src/set_vars.h@0:d05a7158dbad, 2021-02-07 (annotated)
- Committer:
- Oleg_B
- Date:
- Sun Feb 07 05:08:51 2021 +0000
- Revision:
- 0:d05a7158dbad
main prog for PLC1608
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Oleg_B | 0:d05a7158dbad | 1 | |
Oleg_B | 0:d05a7158dbad | 2 | /******* inp-out PLC ************************************/ |
Oleg_B | 0:d05a7158dbad | 3 | |
Oleg_B | 0:d05a7158dbad | 4 | int x01=0; int mx01=0; |
Oleg_B | 0:d05a7158dbad | 5 | int x02=0; int mx02=0; |
Oleg_B | 0:d05a7158dbad | 6 | int x03=0; int mx03=0; |
Oleg_B | 0:d05a7158dbad | 7 | int x04=0; int mx04=0; |
Oleg_B | 0:d05a7158dbad | 8 | int x05=0; int mx05=0; |
Oleg_B | 0:d05a7158dbad | 9 | int x06=0; int mx06=0; |
Oleg_B | 0:d05a7158dbad | 10 | int x07=0; int mx07=0; |
Oleg_B | 0:d05a7158dbad | 11 | int x08=0; int mx08=0; |
Oleg_B | 0:d05a7158dbad | 12 | int x09=0; int mx09=0; |
Oleg_B | 0:d05a7158dbad | 13 | int x10=0; int mx10=0; |
Oleg_B | 0:d05a7158dbad | 14 | int x11=0; int mx11=0; |
Oleg_B | 0:d05a7158dbad | 15 | int x12=0; int mx12=0; |
Oleg_B | 0:d05a7158dbad | 16 | int x13=0; int mx13=0; |
Oleg_B | 0:d05a7158dbad | 17 | int x14=0; int mx14=0; |
Oleg_B | 0:d05a7158dbad | 18 | int x15=0; int mx15=0; |
Oleg_B | 0:d05a7158dbad | 19 | int x16=0; int mx16=0; |
Oleg_B | 0:d05a7158dbad | 20 | |
Oleg_B | 0:d05a7158dbad | 21 | |
Oleg_B | 0:d05a7158dbad | 22 | int y01=0; int my01=0; |
Oleg_B | 0:d05a7158dbad | 23 | int y02=0; int my02=0; |
Oleg_B | 0:d05a7158dbad | 24 | int y03=0; int my03=0; |
Oleg_B | 0:d05a7158dbad | 25 | int y04=0; int my04=0; |
Oleg_B | 0:d05a7158dbad | 26 | int y05=0; int my05=0; |
Oleg_B | 0:d05a7158dbad | 27 | int y06=0; int my06=0; |
Oleg_B | 0:d05a7158dbad | 28 | int y07=0; int my07=0; |
Oleg_B | 0:d05a7158dbad | 29 | int y08=0; int my08=0; |
Oleg_B | 0:d05a7158dbad | 30 | |
Oleg_B | 0:d05a7158dbad | 31 | |
Oleg_B | 0:d05a7158dbad | 32 | float Vin_1=0.0; |
Oleg_B | 0:d05a7158dbad | 33 | float Vin_2=0.0; |
Oleg_B | 0:d05a7158dbad | 34 | float Vin_3=0.0; |
Oleg_B | 0:d05a7158dbad | 35 | float Vin_4=0.0; |
Oleg_B | 0:d05a7158dbad | 36 | |
Oleg_B | 0:d05a7158dbad | 37 | float Vout_1=0.0; |
Oleg_B | 0:d05a7158dbad | 38 | float Vout_2=0.0; |
Oleg_B | 0:d05a7158dbad | 39 | |
Oleg_B | 0:d05a7158dbad | 40 | |
Oleg_B | 0:d05a7158dbad | 41 | int r_mess_id[10]; int w_mess_id[10]; |
Oleg_B | 0:d05a7158dbad | 42 | char r_mess_data[40]; char w_mess_data[40]; |
Oleg_B | 0:d05a7158dbad | 43 | |
Oleg_B | 0:d05a7158dbad | 44 | int r_id=0 ; int w_id=0 ; |
Oleg_B | 0:d05a7158dbad | 45 | char r_b1=0 ; char w_b1=0 ; |
Oleg_B | 0:d05a7158dbad | 46 | char r_b2=0 ; char w_b2=0 ; |
Oleg_B | 0:d05a7158dbad | 47 | char r_b3=0 ; char w_b3=0 ; |
Oleg_B | 0:d05a7158dbad | 48 | char r_b4=0 ; char w_b4=0 ; |
Oleg_B | 0:d05a7158dbad | 49 | int w_alr=0 ; |
Oleg_B | 0:d05a7158dbad | 50 | |
Oleg_B | 0:d05a7158dbad | 51 | |
Oleg_B | 0:d05a7158dbad | 52 | |
Oleg_B | 0:d05a7158dbad | 53 | /****************** DM0806 moduls *********************************/ |
Oleg_B | 0:d05a7158dbad | 54 | |
Oleg_B | 0:d05a7158dbad | 55 | // ----- adr 1 --------- |
Oleg_B | 0:d05a7158dbad | 56 | char dm1_outs=0; |
Oleg_B | 0:d05a7158dbad | 57 | char mdm1_outs=0; |
Oleg_B | 0:d05a7158dbad | 58 | |
Oleg_B | 0:d05a7158dbad | 59 | int x101=0; int mx101=0; |
Oleg_B | 0:d05a7158dbad | 60 | int x102=0; int mx102=0; |
Oleg_B | 0:d05a7158dbad | 61 | int x103=0; int mx103=0; |
Oleg_B | 0:d05a7158dbad | 62 | int x104=0; int mx104=0; |
Oleg_B | 0:d05a7158dbad | 63 | int x105=0; int mx105=0; |
Oleg_B | 0:d05a7158dbad | 64 | int x106=0; int mx106=0; |
Oleg_B | 0:d05a7158dbad | 65 | int x107=0; int mx107=0; |
Oleg_B | 0:d05a7158dbad | 66 | int x108=0; int mx108=0; |
Oleg_B | 0:d05a7158dbad | 67 | |
Oleg_B | 0:d05a7158dbad | 68 | int y101=0; int my101=0; |
Oleg_B | 0:d05a7158dbad | 69 | int y102=0; int my102=0; |
Oleg_B | 0:d05a7158dbad | 70 | int y103=0; int my103=0; |
Oleg_B | 0:d05a7158dbad | 71 | int y104=0; int my104=0; |
Oleg_B | 0:d05a7158dbad | 72 | int y105=0; int my105=0; |
Oleg_B | 0:d05a7158dbad | 73 | int y106=0; int my106=0; |
Oleg_B | 0:d05a7158dbad | 74 | |
Oleg_B | 0:d05a7158dbad | 75 | |
Oleg_B | 0:d05a7158dbad | 76 | // ----- adr 2 --------- |
Oleg_B | 0:d05a7158dbad | 77 | char dm2_outs=0; |
Oleg_B | 0:d05a7158dbad | 78 | char mdm2_outs=0; |
Oleg_B | 0:d05a7158dbad | 79 | |
Oleg_B | 0:d05a7158dbad | 80 | int x201=0; int mx201=0; |
Oleg_B | 0:d05a7158dbad | 81 | int x202=0; int mx202=0; |
Oleg_B | 0:d05a7158dbad | 82 | int x203=0; int mx203=0; |
Oleg_B | 0:d05a7158dbad | 83 | int x204=0; int mx204=0; |
Oleg_B | 0:d05a7158dbad | 84 | int x205=0; int mx205=0; |
Oleg_B | 0:d05a7158dbad | 85 | int x206=0; int mx206=0; |
Oleg_B | 0:d05a7158dbad | 86 | int x207=0; int mx207=0; |
Oleg_B | 0:d05a7158dbad | 87 | int x208=0; int mx208=0; |
Oleg_B | 0:d05a7158dbad | 88 | |
Oleg_B | 0:d05a7158dbad | 89 | int y201=0; int my201=0; |
Oleg_B | 0:d05a7158dbad | 90 | int y202=0; int my202=0; |
Oleg_B | 0:d05a7158dbad | 91 | int y203=0; int my203=0; |
Oleg_B | 0:d05a7158dbad | 92 | int y204=0; int my204=0; |
Oleg_B | 0:d05a7158dbad | 93 | int y205=0; int my205=0; |
Oleg_B | 0:d05a7158dbad | 94 | int y206=0; int my206=0; |
Oleg_B | 0:d05a7158dbad | 95 | |
Oleg_B | 0:d05a7158dbad | 96 | // ----- adr 3 --------- |
Oleg_B | 0:d05a7158dbad | 97 | char dm3_outs=0; |
Oleg_B | 0:d05a7158dbad | 98 | char mdm3_outs=0; |
Oleg_B | 0:d05a7158dbad | 99 | |
Oleg_B | 0:d05a7158dbad | 100 | int x301=0; int mx301=0; |
Oleg_B | 0:d05a7158dbad | 101 | int x302=0; int mx302=0; |
Oleg_B | 0:d05a7158dbad | 102 | int x303=0; int mx303=0; |
Oleg_B | 0:d05a7158dbad | 103 | int x304=0; int mx304=0; |
Oleg_B | 0:d05a7158dbad | 104 | int x305=0; int mx305=0; |
Oleg_B | 0:d05a7158dbad | 105 | int x306=0; int mx306=0; |
Oleg_B | 0:d05a7158dbad | 106 | int x307=0; int mx307=0; |
Oleg_B | 0:d05a7158dbad | 107 | int x308=0; int mx308=0; |
Oleg_B | 0:d05a7158dbad | 108 | |
Oleg_B | 0:d05a7158dbad | 109 | int y301=0; int my301=0; |
Oleg_B | 0:d05a7158dbad | 110 | int y302=0; int my302=0; |
Oleg_B | 0:d05a7158dbad | 111 | int y303=0; int my303=0; |
Oleg_B | 0:d05a7158dbad | 112 | int y304=0; int my304=0; |
Oleg_B | 0:d05a7158dbad | 113 | int y305=0; int my305=0; |
Oleg_B | 0:d05a7158dbad | 114 | int y306=0; int my306=0; |
Oleg_B | 0:d05a7158dbad | 115 | |
Oleg_B | 0:d05a7158dbad | 116 | // ----- adr 4 --------- |
Oleg_B | 0:d05a7158dbad | 117 | char dm4_outs=0; |
Oleg_B | 0:d05a7158dbad | 118 | char mdm4_outs=0; |
Oleg_B | 0:d05a7158dbad | 119 | |
Oleg_B | 0:d05a7158dbad | 120 | int x401=0; int mx401=0; |
Oleg_B | 0:d05a7158dbad | 121 | int x402=0; int mx402=0; |
Oleg_B | 0:d05a7158dbad | 122 | int x403=0; int mx403=0; |
Oleg_B | 0:d05a7158dbad | 123 | int x404=0; int mx404=0; |
Oleg_B | 0:d05a7158dbad | 124 | int x405=0; int mx405=0; |
Oleg_B | 0:d05a7158dbad | 125 | int x406=0; int mx406=0; |
Oleg_B | 0:d05a7158dbad | 126 | int x407=0; int mx407=0; |
Oleg_B | 0:d05a7158dbad | 127 | int x408=0; int mx408=0; |
Oleg_B | 0:d05a7158dbad | 128 | |
Oleg_B | 0:d05a7158dbad | 129 | int y401=0; int my401=0; |
Oleg_B | 0:d05a7158dbad | 130 | int y402=0; int my402=0; |
Oleg_B | 0:d05a7158dbad | 131 | int y403=0; int my403=0; |
Oleg_B | 0:d05a7158dbad | 132 | int y404=0; int my404=0; |
Oleg_B | 0:d05a7158dbad | 133 | int y405=0; int my405=0; |
Oleg_B | 0:d05a7158dbad | 134 | int y406=0; int my406=0; |
Oleg_B | 0:d05a7158dbad | 135 | |
Oleg_B | 0:d05a7158dbad | 136 | |
Oleg_B | 0:d05a7158dbad | 137 | /******************** for SM01 moduls *****************************/ |
Oleg_B | 0:d05a7158dbad | 138 | int sm_position=0; |
Oleg_B | 0:d05a7158dbad | 139 | char sm_outs =0; |
Oleg_B | 0:d05a7158dbad | 140 | |
Oleg_B | 0:d05a7158dbad | 141 | int msm_position=0; |
Oleg_B | 0:d05a7158dbad | 142 | char msm_outs =0; |
Oleg_B | 0:d05a7158dbad | 143 | |
Oleg_B | 0:d05a7158dbad | 144 | // ----- adr 1 --------- |
Oleg_B | 0:d05a7158dbad | 145 | int sm1_pos=0; |
Oleg_B | 0:d05a7158dbad | 146 | int sm1_mov=0; |
Oleg_B | 0:d05a7158dbad | 147 | int sm1_alr=0; |
Oleg_B | 0:d05a7158dbad | 148 | |
Oleg_B | 0:d05a7158dbad | 149 | int a101=0; int ma101=0; |
Oleg_B | 0:d05a7158dbad | 150 | int a102=0; int ma102=0; |
Oleg_B | 0:d05a7158dbad | 151 | int a103=0; int ma103=0; |
Oleg_B | 0:d05a7158dbad | 152 | int a104=0; int ma104=0; |
Oleg_B | 0:d05a7158dbad | 153 | |
Oleg_B | 0:d05a7158dbad | 154 | int b101=0; int mb101=0; |
Oleg_B | 0:d05a7158dbad | 155 | int b102=0; int mb102=0; |
Oleg_B | 0:d05a7158dbad | 156 | |
Oleg_B | 0:d05a7158dbad | 157 | |
Oleg_B | 0:d05a7158dbad | 158 | // ----- adr 2 --------- |
Oleg_B | 0:d05a7158dbad | 159 | int sm2_pos=0; |
Oleg_B | 0:d05a7158dbad | 160 | int sm2_mov=0; |
Oleg_B | 0:d05a7158dbad | 161 | int sm2_alr=0; |
Oleg_B | 0:d05a7158dbad | 162 | |
Oleg_B | 0:d05a7158dbad | 163 | int a201=0; int ma201=0; |
Oleg_B | 0:d05a7158dbad | 164 | int a202=0; int ma202=0; |
Oleg_B | 0:d05a7158dbad | 165 | int a203=0; int ma203=0; |
Oleg_B | 0:d05a7158dbad | 166 | int a204=0; int ma204=0; |
Oleg_B | 0:d05a7158dbad | 167 | |
Oleg_B | 0:d05a7158dbad | 168 | int b201=0; int mb201=0; |
Oleg_B | 0:d05a7158dbad | 169 | int b202=0; int mb202=0; |
Oleg_B | 0:d05a7158dbad | 170 | |
Oleg_B | 0:d05a7158dbad | 171 | |
Oleg_B | 0:d05a7158dbad | 172 | // ----- adr 3 --------- |
Oleg_B | 0:d05a7158dbad | 173 | int sm3_pos=0; |
Oleg_B | 0:d05a7158dbad | 174 | int sm3_mov=0; |
Oleg_B | 0:d05a7158dbad | 175 | int sm3_alr=0; |
Oleg_B | 0:d05a7158dbad | 176 | |
Oleg_B | 0:d05a7158dbad | 177 | int a301=0; int ma301=0; |
Oleg_B | 0:d05a7158dbad | 178 | int a302=0; int ma302=0; |
Oleg_B | 0:d05a7158dbad | 179 | int a303=0; int ma303=0; |
Oleg_B | 0:d05a7158dbad | 180 | int a304=0; int ma304=0; |
Oleg_B | 0:d05a7158dbad | 181 | |
Oleg_B | 0:d05a7158dbad | 182 | int b301=0; int mb301=0; |
Oleg_B | 0:d05a7158dbad | 183 | int b302=0; int mb302=0; |
Oleg_B | 0:d05a7158dbad | 184 | |
Oleg_B | 0:d05a7158dbad | 185 | |
Oleg_B | 0:d05a7158dbad | 186 | // ----- adr 4 --------- |
Oleg_B | 0:d05a7158dbad | 187 | int sm4_pos=0; |
Oleg_B | 0:d05a7158dbad | 188 | int sm4_mov=0; |
Oleg_B | 0:d05a7158dbad | 189 | int sm4_alr=0; |
Oleg_B | 0:d05a7158dbad | 190 | |
Oleg_B | 0:d05a7158dbad | 191 | int a401=0; int ma401=0; |
Oleg_B | 0:d05a7158dbad | 192 | int a402=0; int ma402=0; |
Oleg_B | 0:d05a7158dbad | 193 | int a403=0; int ma403=0; |
Oleg_B | 0:d05a7158dbad | 194 | int a404=0; int ma404=0; |
Oleg_B | 0:d05a7158dbad | 195 | |
Oleg_B | 0:d05a7158dbad | 196 | int b401=0; int mb401=0; |
Oleg_B | 0:d05a7158dbad | 197 | int b402=0; int mb402=0; |
Oleg_B | 0:d05a7158dbad | 198 | |
Oleg_B | 0:d05a7158dbad | 199 | |
Oleg_B | 0:d05a7158dbad | 200 | |
Oleg_B | 0:d05a7158dbad | 201 | /*************** for user *******************************************/ |
Oleg_B | 0:d05a7158dbad | 202 | |
Oleg_B | 0:d05a7158dbad | 203 | // ------------------------ |
Oleg_B | 0:d05a7158dbad | 204 | int t01=0; int t101=0; |
Oleg_B | 0:d05a7158dbad | 205 | int t02=0; int t102=0; |
Oleg_B | 0:d05a7158dbad | 206 | int t03=0; int t103=0; |
Oleg_B | 0:d05a7158dbad | 207 | int t04=0; int t104=0; |
Oleg_B | 0:d05a7158dbad | 208 | int t05=0; int t105=0; |
Oleg_B | 0:d05a7158dbad | 209 | int t06=0; int t106=0; |
Oleg_B | 0:d05a7158dbad | 210 | int t07=0; int t107=0; |
Oleg_B | 0:d05a7158dbad | 211 | int t08=0; int t108=0; |
Oleg_B | 0:d05a7158dbad | 212 | int t09=0; int t109=0; |
Oleg_B | 0:d05a7158dbad | 213 | int t10=0; int t110=0; |
Oleg_B | 0:d05a7158dbad | 214 | |
Oleg_B | 0:d05a7158dbad | 215 | |
Oleg_B | 0:d05a7158dbad | 216 | // --------------------------- |
Oleg_B | 0:d05a7158dbad | 217 | int vr000 = 0 ; |
Oleg_B | 0:d05a7158dbad | 218 | int vr001 = 2 ; |
Oleg_B | 0:d05a7158dbad | 219 | int vr002 = 0 ; |
Oleg_B | 0:d05a7158dbad | 220 | int vr003 = 0 ; |
Oleg_B | 0:d05a7158dbad | 221 | int vr004 = 0 ; |
Oleg_B | 0:d05a7158dbad | 222 | int vr005 = 0 ; |
Oleg_B | 0:d05a7158dbad | 223 | int vr007 = 0 ; |
Oleg_B | 0:d05a7158dbad | 224 | int vr008 = 0 ; |
Oleg_B | 0:d05a7158dbad | 225 | int vr009 = 0 ; |
Oleg_B | 0:d05a7158dbad | 226 | int vr010 = 0 ; |
Oleg_B | 0:d05a7158dbad | 227 | int vr011 = 0 ; |
Oleg_B | 0:d05a7158dbad | 228 | int vr012 = 0 ; |
Oleg_B | 0:d05a7158dbad | 229 | int vr013 = 0 ; |
Oleg_B | 0:d05a7158dbad | 230 | |
Oleg_B | 0:d05a7158dbad | 231 | int pr001 = 0 ; |
Oleg_B | 0:d05a7158dbad | 232 | int pr002 = 0 ; |
Oleg_B | 0:d05a7158dbad | 233 | |
Oleg_B | 0:d05a7158dbad | 234 | int al001 = 0 ; |
Oleg_B | 0:d05a7158dbad | 235 | int al002 = 1 ; |
Oleg_B | 0:d05a7158dbad | 236 | int al003 = 1 ; |
Oleg_B | 0:d05a7158dbad | 237 | int al004 = 0 ; |
Oleg_B | 0:d05a7158dbad | 238 | int al005 = 0 ; |
Oleg_B | 0:d05a7158dbad | 239 | int al006 = 0 ; |
Oleg_B | 0:d05a7158dbad | 240 | int al007 = 0 ; |
Oleg_B | 0:d05a7158dbad | 241 | int al008 = 0 ; |
Oleg_B | 0:d05a7158dbad | 242 | int al009 = 0 ; |
Oleg_B | 0:d05a7158dbad | 243 | int al010 = 0 ; |
Oleg_B | 0:d05a7158dbad | 244 | int al011 = 0 ; |
Oleg_B | 0:d05a7158dbad | 245 | int al012 = 0 ; |
Oleg_B | 0:d05a7158dbad | 246 | int al013 = 0 ; |
Oleg_B | 0:d05a7158dbad | 247 | int al014 = 0 ; |
Oleg_B | 0:d05a7158dbad | 248 | |
Oleg_B | 0:d05a7158dbad | 249 | |
Oleg_B | 0:d05a7158dbad | 250 | |
Oleg_B | 0:d05a7158dbad | 251 |