Sign in to follow this  
Followers 0
BITS N BYTES

CX DESIGNER 2.0 and NS10-V1

10 posts in this topic

Question 1 DATA BLOCK TABLE I have started to use a data block table to store groups of recipes. Everything works fine for numerical data BUT my application also has BOOLEAN settings associated with each recipe. There are pumps, valves and motors each requiring different ON/OFF states within each recipe. Each is assigned a unique bit within an WORD in the PLC data table. So far the ONLY way I can think of getting this to work is to assign a a full WORD in the NS for each BOOLEAN state and the combine all words with multiple OR statements. The result can then be written to the PLC WORD. For example:- Pump 1 uses BOOLEAN H2.00 in the PLC and WORD $HW0 as a FIELD in the DATA BLOCK TABLE of the NS-Screen. Pump 2 uses BOOLEAN H2.01 in the PLC and WORD $HW1 as a FIELD in the DATA BLOCK TABLE of the NS-Screen. Pump 3 uses BOOLEAN H2.02 in the PLC and WORD $HW1 as a FIELD in the DATA BLOCK TABLE of the NS-Screen. etc. etc. When Pump 1 is ON then H2.00 is ON and $HW0 = 1 [Turn on bit 0 of $HW0], IF OFF $HW0 = 0 and H2.00 is OFF. Pump 2 is ON then H2.01 is ON and $HW1 = 2 [Turn on bit 1 of $HW1], IF OFF $HW1 = 0 and H2.01 is ON Pump 3 is ON then H2.02 is ON and $HW2= 4 [Turn on bit 2 of $HW2], IF OFF $HW2 = 0 and H2.00 is OFF etc. etc. The DATA BLOCK TABLES use an $HW word for each FIELD. Combining all $HW words using multiple OR statements could then be written to the PLC's HW2 word thus representing all BOOLEAN states in each recipe. So IF recipe requires the following BOOLEAN states:- PUMP 1=ON then $HW0 = 1 = [0000000000000001] PUMP 2=OFF then $HW1 = 0 = [000000000000000] PUMP 3=ON then $HW2 = 4 = [0000000000000100] Result of multiple OR's is 0000000000000101 is now written to WORD H2.00 in the PLC. This seems an overly complicated way to incorporate BOOLEAN states as individual FIELDS within DATA BLOCK TABLES. I also will need to figure out how to show ON or OFF text in each FIELD versus a value. For example:- $HW0 = 0 display OFF in data table FIELD for PUMP 1. $HW2 = 4 display ON in data table FIELD for PUMP 3. . I'M REALLY STUMPED ON THIS ONE!! AM I MAKING THIS WAY TOO COMPLICATED? ANY ONE HAVE SOME SUGGESTIONS!!! Question 2 In relation to the above anyone know the macro syntax [if it works] for the following problems:- 16 consecutive NS internal BOOLEAN bits $B100 thru $B115. 1 NS internal WORD $W100. Need to copy the state of all 16 bits to the word. Copy the value of the word to all 16 bits. 1 NS internal WORD $W200. What macro syntax could be used to examine the BOOLEAN state of individual bits in $W200. What macro syntax could be used to change the BOOLEAN state of individual bits in $W200. ANY IDEAS??

Share this post


Link to post
Share on other sites
Hi, Why not have just one 'Field' for the pumps (16 bit), and add a digital toggle buttons to individually toggle the on/off status of each bit for each pump as required. This way, the bit status is stored in the table, the PLC can address individual bits from the ladder program etc. The toggle buttons would simply address bits of the same word the table field address refers to. On another note: I have never found the functionality of the Data Block to be suitable for my applications. I always create my own table data storage, and editing system. Nibroc Edited by Nibroc

Share this post


Link to post
Share on other sites
Hi Nibroc, I originally started tried the way you explained BUT the Data Blocks Fields can only be selected as Numeral or String. BOOLEAN is not a choice!!. I am trying to display an ON/OFF String for each pump. Each pump has its own Field in each record. Furthermore when the data table is accessed I don,t want to have to type an ON or OFF string for each pump field. Just touch the FIELD in the RECORD to toggle the setting betweem ON and OFF. I've screwed around for about three [very unproductive] hours today with this blasted DATA BLOCK TABLE function and am rapidly coming to the conclusion that it is also not suitable for my application either. In fact it is SO BADLY DESIGNED and restrictive that I cannot see why anyone would want to use it. Your second statement seems to confirm this. If you could offer some ideas on the best way to create one's own I'd really appreciate the input. BTW Took a look a Hawkes Bay on the WEB - WOW what a great place to live and play. Of course with the occasional day or two of work!! Thnxs B & B

Share this post


Link to post
Share on other sites
Yeah, not such a bad place to be! Nibroc

Share this post


Link to post
Share on other sites
GOT IT! Thnxs a million for the feedback. I had originally thought of using the PLC data table function with READ/WRITE to the PLC mounted memory card but had hoped I could use the 'power' of the NS-Screen with the Data Table function and relieve the PLC from additional logic. Looks like I was barking up the wrong tree. I'll take a look at your suggestions [hopefully will be more productive than today]. TTFN

Share this post


Link to post
Share on other sites
i am working on a project similiar with this one. can some one tell me how to build the .csv file ??

Share this post


Link to post
Share on other sites
Hi, The following will read and write a block of PLC memory to/from the CPU cF card. The data is read/written as a .iom file (binary data) in one continuous block. If you prefer a .csv file, you could use the similar _CARD411_WriteCSV and _CARD_Read211 function blocks. See example below - reads / writes 10000 Data Memory to/from cF. (Files created are 20kB = 10000 16 bit words) Nibroc

Share this post


Link to post
Share on other sites
hi Nibroc, thanks for helping. i can see _CARD210_ReadIOM10.cxf and _CARD211_ReadCSV10.cxf in omron's fb, what's the difference between them? i want to know how to build the csv file. i mean how to put the data in the csv file. how do i know which data the plc is reading for the csv file?

Share this post


Link to post
Share on other sites
You should get a complete description of each function block from the Help button in CX Programmer. Press "Help" then "OMRON Function Block Library"!! Here are the FB descriptions you asked for. _CARD210_ReadIOM.pdf _CARD211_ReadCSV.pdf

Share this post


Link to post
Share on other sites
After I read the data from the CPU CF card and written in one continuous block, how do I display them in the data block table?

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