Example - Ladder Diagram
DGBIN
The DGBIN instruction converts a gray code DWORD value, S, into a binary DWORD value and saves the conversion in an assigned DWORD data register, D.
Ladder Diagram Example
When the contact, M2.0, is powered ON (1), the value of the gray code WORD data register, D50, 943,761, is converted into binary notation.
The value of the conversion, 768,798, is saved in the WORD data register, D53.
Memory Monitor
![]()
DGBINP
The DGBINP one-shot instruction converts a gray code DWORD value, S, into a binary DWORD value and saves the conversion in an assigned DWORD data register, D.
Every time this instruction executes, it energizes the output only once.
Ladder Diagram Example
When the contact, M2.1, is powered ON (1), the value of the gray code WORD data register, D56, 56,457,585, is converted into binary notation.
The value of the conversion, 40,480,338, is saved in the WORD data register, D59.
Memory Monitor
![]()