9/14/2013 6:02 PM | |
Joined: 1/28/2009 Last visit: 5/2/2024 Posts: 6838 Rating: (1359) |
Hello again, I suggest 2 solutions in SCL:
For a solution in STL, you need to test each active bits by checking bit by bit of data in loop.That is possible by masking and shifting data and if active , copy data to output. Best regards Hamid Hosseini |
Last edited by: hdhosseini at: 9/14/2013 6:18 PM// new data added |
|
9/18/2013 12:32 PM | |
Posts: 61 Rating: (0) |
hey berg this would not work ... its just transfering the value in DB i have to check which bit is set of input word and set the respective bit of db4 if the bit 6 of the input word is high (input word value =20 H ) so i have to set 6th bit in DB ( dbx 34.5 ) hdhosseini in am doning that what u have said "in STL, you need to test each active bits by checking bit by bit of data in loop" but loop is not running i also tried jump command that not working |
9/18/2013 3:09 PM | |
Joined: 1/28/2009 Last visit: 5/2/2024 Posts: 6838 Rating: (1359)
|
Please note, personally I prefer using SCL as it is really easier than this.Test it because it is not tested thoroughly: [code]// initialize A BYTE IN local OB1 L 2#10011101 T #data //program OPN DB 1 LAR1 P#DBX 0.7 L 8 lp: T #lp_z DEC 1 L 1 SLW L #data AW L 0 ==I JCN one CLR = [AR1,P#0.0] JU ende one: SET = [AR1,P#0.0] ende: NOP 0 L L#-1 +AR1 L #lp_z LOOP lp[/code] Hamid Hosseini |
Last edited by: hdhosseini at: 9/18/2013 3:11 PM |
|
Follow us on