
adccommunitymod (AutomationDirect) asked a question.
Question about controlling the bit in a word
Created Date: January 23,2013
Created By: trimixdiver1
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I can see a word, viewed in binary. How do I control that bit? or make it a contact? Im using a do more. Thanks
Created Date: January 23,2013
Created by: Do-more PE
Use casting. Adding a ': ' and the bit number of the word you want to use as a suffix to the memory location. IE: V0:1 is bit 1 of V0. D15:12 would be bit 12 of D15.
Created Date: January 23,2013
Created by: trimixdiver1
Perfect! That's what I wanted. Now I have to load the word in a v memory location
Created Date: January 23,2013
Created by: franji1
Casting Help in Element Browser (F9)
To help users with Casting in Do-more Designer, the Element Browser has an additional utility for building up casts. The Element Browser is available just about anywhere a PLC element editor field exists, and can be brought up by hitting the F9 key (just like in DirectSOFT).
Attached is a screen shot highlighting the key parts of the Cast Builder feature.
1. Hit the More button to expand the Element Browser to reveal the Cast Builder controls.
2a or 2b. Either select the data block in the list or enter the PLC element you wish to cast (e.g. V0 or D10 or X32).
3. For this example, we are wanting to pick the least significant bit of V0 (bit 0 is the LSBit, bit 15 is the MSbit of a 16 bit word V), so in the Size radio button region, we pick Bit.
4. Now select the specific bit number, and for WORD, the bit number range is 0-15, and we want bit 0.
Note that as you select different options in the various radio buttons and cast offsets, the text in the Source Element field 2a will reflect the text representation INSTANTLY as you click on them, to help you learn the syntax of cast building on your own.
In addition, you can try out your casting knowledge and type the text in the Source Element field and similarly, the radio buttons and cast offsets will reflect that cast representation automagically.
For more details on the Element Browser and its Cast Builder, check out the Do-more Designer Help System topic number DMD0275 (search on that topic number).
Created Date: January 23,2013
Created by: trimixdiver1
Thanks a lot for that!
Now if I were to want to connect to a vfd via rs485, do I use the device boxes?Like DEVREAD? Basically to get the vfd data to a v memory location?
Created Date: January 24,2013
Created by: franji1
Thanks a lot for that!
Now if I were to want to connect to a vfd via rs485, do I use the device boxes?Like DEVREAD? Basically to get the vfd data to a v memory location?
No. I'm assuming that your vfd speaks Modbus/RTU? If so, you will need to configure a serial port for Modbus/RTU Master (the vfd is the slave in this case).
If you want to use the RJ-12 RS-232 port on your DM1 CPU, you will need an RS-232 to RS-485 converter (e.g. ADC sells the FA-ISOCON, but somebody else out there can help you better than I). You can also purchase an H2-SERIO4, which the third port is RS-485.
Once you have the right port and right cable, you must configure THAT SPECIFIC Port to be Modbus/RTU Master in the System Configuration (CPU or Module/slot, based on which port you ended up using).
Use the MRX instruction to do Modbus Reads and MWX instruction to do Modbus Writes.
If you 've never done communications before, let us know.
Created Date: January 23,2013
Created by: trimixdiver1
I can see a word, viewed in binary. How do I control that bit? or make it a contact? Im using a do more.
Thanks