would like to know if this is possible Controllogix5000

Join Date
Apr 2003
Location
Toronto
Posts
151
I have a 1769-L16 that is Ethernet connected to a AC vector drive. The drive has no keypad but there is an integer that comes from it 1 - 45 each number has a definition for example the value 17 = motor over temperature. Is it possible to make a function block that accepts a value from 1 -45 and spit out a description 20 characters long. I am thinking of placing this function block as the first rung in the fault routine. This way the programmer can see what is happening with the drive.

I spent 3 hours checking the comms and hardware and programming only to discover (added a keypad to the drive) that the drive was waiting for a over-temperature motor to be looked at. Not good.

I know i can do this with comparitors if x = 17 then turn on output 3, but this would take 45 rungs, i want to see that the drive issue is motor over-temperature. If there are no faults the value =0
 
I would like to see the function block spit it out inside the program. As there are 45 faults that could happen and only a few are really acted on. Some are ignored and are not necessary but it would be nice to see a function block spit out the text information. Ideally it would be an integer in and some code that would produce the 20 character string.
 
I have done almost exactly this before - extract an error code from a drive and display a string on the SCADA screens to tell the operator what it means.

My logic was in an add-on instruction, but yours doesn't necessarily need to be. If your error codes are 1-45, then it's really easy. Create an array of STRING's with 46 elements (if you only need 20 characters each, you could create a string data type of length 20 called, say, ERRORMSG, and create an array of them instead. Up to you). Then, in each element of that array, enter the text for that error message. e.g. if 17=motor overtemperature, then YourStringArray[17] should have the value "Motor Overtemperature".

Then create a single STRING (or ERRORMSG, if you went that way) called, say, DriveStatus, and every time the number on your drive changes just copy YourStringArray[DriveErrorCode] to DriveStatus.

It may be worth putting a clamp on your DriveErrorCode just before you execute this, so that on the off chance it exceeds 45, your PLC doesn't crash ;)

In my situation it was a bit more complicated than that, because not only did I have about 80 possible error codes per drive, but they weren't numbered 1-80. They ranged anywhere from 1-400ish. So I had to do something a bit trickier with UDT's and an FSC instruction - I can go into more detail on that if you think it would help, but by the sounds of it the easy approach should work just fine for you here.

Good luck!
 
Ok i have it but the copy instruction does not show me what i want to see, i tried the move instruction but it ill not let me move a string array into another string. The copy will do it but i do not see what is inside the copied register unless i go and look into the Tag data base: COP(ERROR_MSG[POINT],DRIVE_STATUS,20)

Remember I would like to see this register on the top of my Fault routine so that I can see what the drive is doing. The mechanics of this algorithm works as my number changes from 1 - 45 the register "DRIVE_STATUS" holds the correct information, it is still buried in the tag data base. I need to search for the tag and then view the tag etc.
 
Last edited:
As far as I know the only way to view the contents of a string type tag is in the tag database. I've never found a way to do that anyway - I had a SCADA screen to play with so that was easy :)

Just a note too, on your COP instruction...the length parameter specifies the length to be copied in destination elements. A STRING data type has two components: DATA, which is an array of SINT's (bytes), with each byte storing one character of your text; and LEN, which is a DINT that specifies the length of the string. Or more accurately, the length of meaningful data in the string. So if your string contains "abc", the LEN value is 3. If your string contains "abcde", your LEN is 5. And so on.

If you set a copy length of 20, you need to specify that you're copying 20 bytes, not 20 strings. For example:

COP Error_Msg_Database[Fault_Code].DATA[0], Drive_Status.DATA[0], 20
The data type of the destination element is SINT, because you have drilled right down to the DATA array of SINT's. So this code tells the PLC to copy the first 20 bytes in the specified Error_Msg_Database string to the first 20 bytes of the Drive_Status string. (protip: if you're then displaying this string on a panelview, you also need to move the LEN value, or you can get unwanted results. Not relevant to you, but worth knowing)

If, instead, you type:
COP Error_Msg_Database[Fault_Code], Drive_Status, 20
The data type of the destination element is STRING (or whatever you called your 20-character string). So this will tell the PLC to copy the entire specified Error_Msg_Database string and 19 strings after that. So your COP instruction could be overwriting other tags in your PLC with the next 20 error codes! This can make you have a very bad time.

The correct way to do it is either the first method above, or just:
COP Error_Msg_Database[Fault_Code], Drive_Status, 1
Which will copy just that one string.
 
Last edited:
I did change it to a 1 as I was getting some strange results on the next line of logic which is 'UPPER' then i basically plugged in my strings and I got an ok result, that is my programming block now tells me what the drive is doing. I was kind of hoping to make an add on instruction so that you can connect the input (integer or POINTER) and then have the block display what that pointer is.

Anyway its 6:30 PM time to go home TY.
 
I know what you mean. Trouble is, the only way to get a STRING data type in and out of an AOI is to make it an InOut tag. And the AOI doesn't show you the contents of InOut parameters.
 
Change your rung to the following and see how it works for you:
COP Error_Msg[Point] Drive_Status 1 EQU Drive_Status Drive_Status NOP

The EQU instruction will display the stored value of Drive Status for you.
 

Similar Topics

Hello All, I need the ability to remotely reboot a Red Lion CR3000 HMI. Due to some graphics issues when the database is updated the HMI must be...
Replies
4
Views
218
Hello The plant is running and there is no shutdown nowadays therefore I can add 1734- AENTR and its card while PLC is in Run? I do not wanna...
Replies
8
Views
344
Folks, I have a client with an old ABB Advant / MOD300 system (v14.4). Around y2k I installed the ABB Industrial IT MOD300 OPC Server 1.1/2...
Replies
1
Views
178
Hi all so i have a robot project im working on were i need to set the layers. using the hmi screen i would like to use the numeric data display to...
Replies
11
Views
818
I have a FactoryTalk View Se project, Is it possible to export Direct Reference tags to edit in a CSV file or Excel? I know I can export HMI...
Replies
1
Views
288
Back
Top Bottom