Mitsi bit set

cjd1965

Lifetime Supporting Member
Join Date
Apr 2007
Location
UK
Posts
1,659
Hi
I have a lot (several hundred) alarms (M bits), which are not sequential . I want to 'collect' these into D words for logging.

What i want to do is to define a start word, then set bits from 0 to 200 .

I beleive BSET only works for 16 bits. Its an A series PLC

Any ideas?
 
The task is still unclear.
Did you mean regrouping alarm bits to sequential array of 0 to 200, and controlling them by BSET?
Or copying existing non-sequential bits to sequential copy image by using BSET?
And specify your PLC model.
 
If your bits are not sequential then you are going to have to do it individualy,
e.g.
And M 1 BSET D0 K1)This will set Bit 1 in D0
A M6 BSET D0 K2 & so on
The problem is that you will have to reset them when the M bit is off.
If a lot of the M bits are in order i.e. you have at least 16 in order then MOV M1K4 D0 will copy 16 bits M1-16 to D0, you could then use bitset on odd ones, also as the mov instruction would be in scan, & continually refreshed you will not need to reset the D registers
The best way would be to re-organise the program so all alarms are in order but I assume you have an HMI on this otherwise there would be no point in alarms, of course this would mean modifying the HMI as well.
 
Thanks for the replies. I am familiar with the bitsethowever i was looking for something more clever.

I wrote a subroutine (call Pxx) to which I sent a 1 or 0 and the bit offset.

I then divided the bit offset by 16 to obtain a z offset function for the base register, and the modulus -1 for the bit.

I then set or reset the target bit depending on the 1 or 0

However, the code to load the data and call the function was equal to the bitset /reset so it was easier to simply use set/reset directly.

Cheers
 

Similar Topics

Hi I am having a brain ache. What is the instruction to set a bit in a word, kinda like (set bit 2 of word D2) or (reset bit 2 of word D2). I...
Replies
3
Views
3,200
hi I am trying to map a series of bits (m20, m21, m22 etc) to one word, as i am going to map the single word from the mitsi plc to a allen...
Replies
4
Views
1,920
can somebody unravel the gobbledy gook for me or am I just being stupid, I understand basic registers but the manual just gave me a headache at...
Replies
2
Views
2,068
We've got 2 cooling fans on our system. They switch on based on water temperature. One switches on at 25c. The other switches on at 30c. The code...
Replies
16
Views
3,068
I have a siemens 317-2 and an old GOT1000 (GT1675M - V) I am trying to get the darn things communication and having no luck. I have followed the...
Replies
12
Views
2,122
Back
Top Bottom