CAI_Support
Senior Member
Current shipping firmware should allow user to have non-blocking delay on IP, at same time to get IP current state. In your example, VAR1 could have different value from IP1[1000] during delay.
CAI_Support said:Okay, I am drawing a picture to show you what original logic would do and what you proposed would result:
rossw said:I have not tested my code, but I think your diagram is wrong.
See the XOR? After detecting a "change of state" it then XORs the "last" state with the "current" state. If unchanged, no action. That would achieve the same filtering function the current code does, except on both normally high and normally low inputs, yes??
CAI_Support said:Ross,
You and az1324 are advanced engineers, from postings both of you did, we made great improvement to the product features. I am sure we will careful consider all your suggestions. Once engineers understand your suggestions, we can implemented for you. For this particular requirement from Tim, we want to find a way without impact existing users, also can handle both direction going pulses.
Edge detection is a good idea. How could that be used to help Tim's case, also without impacting current users, that is not very clear. If that is not feasible, we can introduce totally new command to read same TTL input and using different logic more versatile for all purposes.
You are correct 100ms is not the smallest time for reading TTL input, actually, each time PLC reference to TTL value, it will read it, if it changed from last time, it will record that change. So if you want to do communication, you first have a long pulse, so that if your PLC code take one whole second to loop through, this long pulse will make sure you will run into it. Then you can call the communication subroutine, where you can just beat up the IP line for state change. Other interrupt, like network, could steal CPU from your routine.
Would you like to suggestion a totally new command or we just let programmer to change the 0V->5V detection to 5V->0V detection?