Red Lion HMI and Toshiba PLC Help

oreo2996

Member
Join Date
Mar 2016
Location
BC
Posts
19
I've got a Red Lion G304K200 HMI connected to a Toshiba T2N PLC, and I am attempting to display a pressure value, which has the address of XW000 D0100 in the PLC's ladder logic.

Using Red Lion's programming software, Crimson 3.0, this sort of thing is done using a data tag. In the creation of a data tag, I am faced with a number of different settings to choose from, and I am not familiar with any of them. The settings I have tried thus far have failed at displaying the correct value. Perhaps somebody here will be able to advise me on what settings to use to successfully display the pressure value.

For those unfamiliar with creating data tags in crimson, here is a breakdown of the settings it gives me, listed as numbered "variables", as I planned on getting past this issue via trial and error, but with the current number of variables it would take forever to find the correct combination. If you are able to help with any of the variables it would be extremely helpful, as if I know the correct value of at least one of them it will make things a lot easier.

The first 3 are all under the "Data Source" > "Source" menu in crimson.

1. "Data Item":
D - Data Registers
F - File Registers
XW - Input Words
YW - Output Words
RW - RW Registers
T - Timers
C - Counters

2. "Element" which is just 4 numbers that I can fill in. I assume that if I pick D as my data item then I would use 0100 as the element, to make D0100, and if I pick XW as my data item then I would use 000 as the element, to make XW000, but again, I'm not sure.

3. "Data Type":
Word as Word
Word as Real
Long as Long
Real as Real

#4 through to #7 are under the "Data Source" menu.



4. "Extent"
One Item
Array

5. "Manipulation"
None
Invert Bits
Reverse Bits
Reverse Bytes
Reverse Words
BCD to Binary

6. "Treat As"
Signed Integer
Floating Point
Unsigned Integer

7. "Access"
Read and Write
Write Only
Read Only

#8 is under the "Format" > "Format Type" menu.

8. "Format Type"

General

Linked

Numeric

Scientific

Time and Date

IP Address

Two-State

Multi-State


Please let me know if there are any of the variables you can advise me on.

Thank you.
 
First, start off by getting the value to match the raw number in D0100. I would think that you just want to select that address in the source and treat as signed or unsigned integer. That choice depends on the value you expect in the register. I am not familiar with Toshiba PLCs or their addressing and numbering systems.

Leave the other settings at the defaults.

Put the tag on a screen and run it.
Make sure it matches and if it does not, tell us what it should read versus what it does read.

I have never had to reverse the bits but I suppose they provide that feature for a reason. Reversing bytes I have used once, and it may come into play. Reversing words won't apply since you are dealing with one word.

You may need unsigned integer if you need to represent a number from 0-65535.

You may need signed integer if you need to represent 2s complement signed numbers (-32768 to 32767).

The format type we can worry about once you get raw numbers reading properly.
You will likely end up choosing Numeric as the format type, and then you can apply scaling. The other types have a wide variety of other uses.
 
What do you mean by "the raw number in D0100"? Do you mean the actual value of the pressure?

Okay, so I've gone and created a data tag with "D0100" as the source with "Word as Word" as the data type.

The value it should be is around 5500, so I selected unsigned integer.

The value displayed is 53504, and does not fluctuate at all.

The value for D0100 in the PLC's ladder logic is between 5500 and 5514 and is constantly fluctuating.
 
What do you mean by "the raw number in D0100"? Do you mean the actual value of the pressure?

I do not know Toshiba, so I meant the data. Is it already scaled to engineering units in that register? I also thought it might be "raw counts" copied from an analog input point.

Okay, so I've gone and created a data tag with "D0100" as the source with "Word as Word" as the data type.

The value it should be is around 5500, so I selected unsigned integer.

The value displayed is 53504, and does not fluctuate at all.

The value for D0100 in the PLC's ladder logic is between 5500 and 5514 and is constantly fluctuating.

The fact that its changing in the PLC and not in the HMI makes me suspect that there is a problem with the driver setup or that you are reading the wrong address somehow.

If it was a byte swap i'd expect to see 5500 converted to 31765.

Is D0100 represented as a real number in the Toshiba? Can you share the details of the driver setup?
 
As far as I know, yes, the ladder logic shows the variable D0100, and above it there's the 5500, which I can confirm is the correct value in PSI.

As far as the driver setup, crimson has it as an option in the comms drivers. Under the RS-485 Mode port, I've selected the Toshiba Series PLC driver, with the following settings:
Baud Rate: 9600
Data Bits: Eight
Stop Bits: One
Parity: Odd
Port Mode: 4-Wire RS485 or RS422

And then within that, the PLC has some device settings as well. I've got it set to the following:

Enable Device: Yes
Drop Number: 1
PLC: T-Series
Spanning Reads: Enabled
Transactional Writes: Enabled
Preempt Other Devices: No
Favor UI Writes: No
Comms Delay: 0 ms

I'm not sure what you're asking about D0100 being represented as a real number, but I can show you a picture of the ladder logic if you would like, so you can see for yourself. But like I said earlier, there is a number above D0100 and it is the value of the pressure in PSI.
 
Real number = floating point in Red Lion's parlance. Just out of curiosity, what does the HMI read if you change the tag's source to D0101? If it is a float in the PLC, the driver might be splitting the high and low order words across adjacent registers.
 
Real number = floating point in Red Lion's parlance.

So are you saying I need to have it set to read Real as Real as well as set to floating point?

Just out of curiosity, what does the HMI read if you change the tag's source to D0101? If it is a float in the PLC, the driver might be splitting the high and low order words across adjacent registers.

D0101 is actually the address of another pressure, but I figured I'd only mention the one pressure to simplify things.

I've set up data tags for both D0100 and D0101, and here is what I am seeing:

D0100: HMI - 53504, PLC - ~5375
D0101: HMI - 43, PLC - ~470

Here's a screenshot of the block I'm looking at in my PLC's program. The DataBox is showing the details on D0100, perhaps that will help with identifying the correct settings, as it is mostly gibberish to me.

http://i.imgur.com/Xc8iEuM.png
 
Looks like a single INT to me in your screenshot. 16 bit integer, not a SINT, just a regular old INT.

Two ideas:

In Crimson, when you go to the Communications setup, click on the Toshiba PLC and note the Device number in the status bar (lower left) or the PLC name you have given it. I think the default will be PLC1.

Create a tag called CommsOkay or something like that. Make it a flag tag.

Set its source to General and put IsDeviceOnline("PLC1")

Put that tag on your screen and find out whether it is on or off. IsDeviceOnline() returns a value of 1 when the comms are working and 0 when not. You can put the device name in the function or the device number.

So if IsDeviceOnline returns a zero for your Toshiba, then you aren't talking at all yet. You need that to be true before proceeding. If not talking at all, however, your tag values should be displayed on the HMI as "----" instead of numbers. This can also be affected by whether or not you have Simulate As filled in on your tag data page. In any case, that Comms tag with IsDeviceOnline is SOP for all my crimson projects. I usually set up an alarm with a 5000ms delay for that tag too, so when I lose comms, I get an alarm. So do this even if you are sure they are talking. It will be handy later.

A value of 470 would be 1D6 (using windows calculator programmer view). If byte swapped, that would be D601 which would result in 54785. That is not too far off from what you show in D0100. Could it be that the driver is "off" by one work (like what happens a lot with Modbus) and needs to be byte swapped?

53504 and 5500 is a whole lotta psi, by the way...
 
Last edited:
I will try the IsDeviceOnline thing in a minute when I get a chance.

Yes 54785 is close to what the HMI is showing for D0100, but the thing is what the HMI is showing for D0100 is wrong. 53504 is not the correct PSI, whereas 5500 is correct.
 
Set its source to General and put IsDeviceOnline("PLC1")
What do you mean by "put IsDeviceOnline("PLC1")"? When I create the flag tag and set the source to be General, there is a text box that shows up next to "General", so I tried putting it there, but it tells me "Argument 1 of function 'IsDeviceOnline must be a comms device or an integer." When I remove the quotations around PLC1 though, it allows me to leave it there.

When I connect the PLC cable, it does indeed say that the device is ON.

I've attached the .cd3 file.
 
Yeah, my bad on the quotation marks. working from memory...

If it is on, then you definitely have the comms set up right as far as wiring, baud rate etc.

How about you find an unused D memory location in the Toshiba. Put a value of "1" (without the quotes ;) ) in it and read it. Then maybe we can get a handle on what is happening.
 
No worries!

Okay.

I'm afraid I have even less experience with programming PLCs, how exactly do I do it?
 
I made a new version with the same two tags shown as hex and binary in addition to the tag format. In the tag picker, i switched them back to "word as word". I am pretty sure "real as real" is not what you will want.

I think we will nail this thing down when you can pick a new address that you can manipulate manually in the Toshiba, but try this one and see if it reveals something.

EDIT: I am using an older version of Crimson here at the house. My internet connection is so slow it would take me an hour to upgrade. Since your app is so simple, I doubt that anything broke when I opened it. You may get a similar warning when you open my version saved with Build 640, but it should be safe to proceed with no problems.
 
Last edited:
With the updated file, it displays the following.

D0100: -12032
D0100 Hex: +BIG
D0100 Binary: +BIG

D0101: 43
D0101 Hex: 002B
D0101 Binary: +BIG

If you could provide some details on how to add the new address I will give it a try.
 
Last edited:

Similar Topics

I am having issues getting a Red Lion HMI and Micro830 controller to communicate. I am using the cable here to connect the controller to the RS232...
Replies
0
Views
117
Hi I need to send a null command down a comms port. But in the crimson software when i used /x00 it coming back "Cannot use null character is...
Replies
2
Views
420
Hi Everyone, I am hoping a Red Lion Expert can point me in the right direction. I am experimenting with data logging on a CR3000 10" screen...
Replies
4
Views
602
I have a Red Lion G09 scanning 8 Invertek P2 VFDs via modbus RTU - I've setup necessary comms and tags and all works well. I have a 'Settings'...
Replies
3
Views
1,869
Has anyone ever replaced a touch screen on a legacy Red Lion G3 series HMI?
Replies
12
Views
1,451
Back
Top Bottom