Help - Search - Members - Calendar
Full Version: CX DESIGNER 2.0 and NS10-V1
Forums.MrPLC.com > PLCs and Supporting Devices > Omron > CX-Designer
BITS N BYTES
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??

disgust.gif shrug.gif



Nibroc
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
BITS N BYTES
QUOTE(Nibroc @ Sep 12 2007, 04:34 PM) [snapback]59124[/snapback]
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


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

smile.gif




Nibroc


QUOTE
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.


As mentioned, I have never used it. The applications where I use 'variable' data tables, are where a process steps through a sequence, each step has various variables (booleans/numerals). The Data table seems to be designed where you select one record to process, and that is that!

QUOTE
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!!.


Yes, but there is nothing stopping you adding your own buttons to manipulate the bits within the numeral data type. Simply address your buttons to the same word.

Having said this, I suspect you will be better off implementing your own system. I normally set up a system where I use the PLC to store the 'recipe' data on the CPU compact flash card. The 'recipe' data is a block of DM where there are say 100 steps, each of 100 words (so total 10kDM for recipe). Each 100 step words are used for bits, values etc. The PLC has a step index, and dynamically moves the current step (100 words) into an operating/editing area (say W area). I configure an NS screen to edit the steps, with next/prev buttons to increment/decrement the step index. A separate NS screen is configured to provide the selection/read/write interface to/from the compact flash. Normally I have an edit area (eg EM memory) and operate area (eg DM memory) to allow the PLC to be able to 'operate' a recipe at the same time someone is editing one etc.

Have a look at the picture



QUOTE
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!!


Yeah, not such a bad place to be!

Nibroc
BITS N BYTES
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
devilyao
i am working on a project similiar with this one.
can some one tell me how to build the .csv file ??
Nibroc
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


devilyao
QUOTE(Nibroc @ Sep 14 2007, 03:36 PM) [snapback]59196[/snapback]

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


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?
BITS N BYTES
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.

smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.