Omron NJ Address bool inside INT

HJTRBO

Member
Join Date
Jul 2008
Location
Melbourne
Posts
618
Hi all,

In logix5000 I can have an array of ints (My_Logix_Int[2] of type INT). I can address the first bit of the first array member by writing my_int[0].0

How do I acheive the same using Sysmac Studio? I have tried the Logix method and the program check doesn't like it. I'm searching through the manuals now but thought i'd query here too.

Cheers, NP
 
i don't know about SYSMAC STUDIO,

base on CJ,

you need to go SYMBOL,

insert symbol,give name

select what type

go advance setting,total array,

select address or value eg. W1.00 [100]

and validate the symbol.
 
Wow, I hate this software. It reeks of TIA Portal. It's so inflexible. I use Logix mainly, and I can see why it's so popular. It's just easy to use, and you can manipulate and work with differing data types very easily. This ****, pretty much every instruction requires matching data types. Selecting and creating rungs is slow and horrible.

But anyhow, after all that you have to create a union data structure with 2 members. One of an array of bools and the other of a single word. Then I have to write my actual int into a temp word via a convert int to word instruction, then move it into the word member of the union structure. Now I have access to the bits. OMG WHAT A PIECE OF ****
 
Man, I agree! CX-P is wonderful and was developed in Europe - I hear this is from Japan - going backwards?
 
Yep, I agree back with ya there BobB, CX-P whilst been older and not sporting much graphics bling, it sure is easy to use!
 
Originally posted by HJTRBO:

...pretty much every instruction requires matching data types.

That is more the rule than the exception with plcs. I think AB is one of the few that do automatic type promotion. And since none of the AB stuff it truly compiled (regardless of what Logix5K says before downloading) this is pretty expensive from a processing standpoint, especially with something like a CPT. If anyone wonders how the "other guys" get more from less, this is one of the ways.

Originally posted by HJTRBO:

But anyhow, after all that you have to create a union data structure with 2 members

This is actually something I wish AB supported. They do have it after a fashion with aliasing but a true union would be cleaner in my opinion.

Keith
 
In SYSMAC STUDIO Unions do not support INT variables but do support WORD variables. So you could use that.
Another method is to use STRUCTURES.
See attached images.

Structure of Array BOOLEAN.JPG Global Variable Array using Structure.JPG Program using global array.jpg
 
Hey guy's

I also need to convert an UINT to single bits and I never used Omrom before. More then 10 years working with Siemens.

So I figured out how to create a Union type. I now have one with:
- B: Array[0..15] OF bool
- W: WORD

So with the instruction "UINT_TO_WORD" I'm able to load the UINT into the union word, but how do I get that word into the bits?
 
Hmm, another question. It seems to work but I get a warnings.

I load an UINT to a Word from an Union Data type. From that Union I read out the bits but I get the following warnings:
"The output used as an internal bit is not referenced from others" for the Word.
'The input used as internal bit is not written from others" for the bits I read out from the union.

Is that normal? Should I ignore it, or am I doing something wrong? It will give a lot off warnings...
 
Last edited:
try this first,


1.) MOVE
in -> UINT location (value 4096)
out -> W(X) (16 Bit )

2.) LD W(X.0)
OUT W(Y.0)

UNTIL

LD W(X.15)
OUT W(Y.15)
 

Similar Topics

Hi everyone, I am working on a project to protect program memory on Omron CP series PLCs. there is several ways to write protection that i've...
Replies
4
Views
635
Hi, I am very much a novice when it comes to PLC's I have only ever had to change the IP address on them, and go off notes left by a previous...
Replies
3
Views
1,004
Is there an efficient tool to manage and validate CX-Programmer addressing. Requirements: - Highlight Duplicate Address allocation -...
Replies
9
Views
2,376
Just thought I would throw this out there. History - A couple weeks ago we had an Omron NE1A brick. Could not upload download to it after it...
Replies
0
Views
1,019
Hi, I am new for Omron PLC. For now, I have a project using Omron CJ2M CPU35. I have no idea how to find where is IO address. Because there is...
Replies
2
Views
1,322
Back
Top Bottom