Sign in to follow this  
Followers 0
RobinA

Time Stamp input change of state for Diagnostic

5 posts in this topic

I want to use the the real time clock to time stamp the change of state of a few inputs, for Diagnostic work. ( FX2n) Is there a handy way to do this ? So far I've tagged a few inputs to call a sequence that read the time and stores it in the next few registers [TRD D500V0] the increment V0 by 10. But I need to store which input triggered this, is there someway of setting a bit in say d100 against this ? Is it possible to reduce the number of regs used by combining them ? I realise I 'll soon run out of regesters so thinking of setting a round Robin We do not have an HMI on the machine , so it it will be a case of taking along the laptop and uploading the regs and waiding though them to see what order things happened in/button pressed by the operator Thanks in advance

Share this post


Link to post
Share on other sites
If I understand you correctly you've basically completed your task, but you need to store which bit triggered a specific timestamp. You would like to use e.g. D100, bit0 to store the status of which input triggered the timestamp? I would simply use a MOV instruction, if Input1 triggered the timestamp then move 1 into D100, if Input 4 triggered the timestamp move 4 into D100 and so on... This would be the easiest.

Share this post


Link to post
Share on other sites
Or you could move the status of 16 bits into a data register. MOV K4X0 D100 As for a way to pack it into less registers, its funny you should ask that. The Q and L Series do exactly that with their clock data, store it in 4 registers. But they also offer DATERD and DATEWR (same as TRD/TWR) which will move it to 7 individual registers. As for how to pack it, consider converting it to BCD, then using commands like SWAP to add values together. So for example, convert the data to BCD, then use SWAP to move the lower byte to the upper byte, then add the BCD value of the second value. So if your month and day are 10/31, convert the 10 to BCD, swap it to the upper byte, then convert the 31 to BCD and add it to the first value. Then when you view the register in hex, you can see month and day in one register. BCD D1 D10 SWAP D10 BCD D2 D11 ADD D10 D11 D12 D12 would contain the month and day in BCD.

Share this post


Link to post
Share on other sites
Jeeeeeeepers you guys are quick ! Thanks for the pointers, that's what i was looking for. I didnt know you could do the Move K4X0 D100. As the inputs are not in order so to speak I set/reset consecutive M regs eg X1 -> M100 X21 -> M101 X22 -> M102 M24 -> M102 then Move K4M100 D100 getting there with Thanks

Share this post


Link to post
Share on other sites
Consider upgrading to FX3U and you can make use of the R Registers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0