You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 13th, 2002, 04:17 PM   #1
Steve Meisel
Member
United States

Steve Meisel is offline
 
Steve Meisel's Avatar
 
Join Date: Jun 2002
Location: NC
Posts: 77
Question String Files VS Integer Files

What is the differance between an integer file and a string file? I know that a string can hold letters, but is there any other differance? If I extract 4 integers out of a string of 20 they are the same integers that were in the string (no converting done by the processor). Maybe I am making looking too deep at this.

Thanks,

Steve
  Reply With Quote
Old September 13th, 2002, 04:42 PM   #2
Tom Jenkins
Lifetime Supporting Member
United States

Tom Jenkins is offline
 
Tom Jenkins's Avatar
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 5,904
First off, if you identify the platform you are working on (Brand and Model and Programming Software Package and Version) you can get better answers.

In general, though, string files treat all characters the same. In many cases a "2" in a string file doesn't have a numerical value equal to "1+1". Instead, it is simply treated by the PLC as a character with the ASCII value of 50 (decimal). It looks like a "2", but you may not be able to do numerical calculations with it.

In an integer file the "2" is really the number "2" and can be added or multiplied etc. In this case the "2" is treated by the PLC as a number with the binary equivalent of 00000010.
  Reply With Quote
Old September 13th, 2002, 07:02 PM   #3
Steve Meisel
Member
United States

Steve Meisel is offline
 
Steve Meisel's Avatar
 
Join Date: Jun 2002
Location: NC
Posts: 77
I am working with slc5/04's using RSLogix500 v5.00 and AI500 8.18. I am adding a new part to a palletized assy line. The strings are used to transfer data to a basic module then on to Omron Tags on the pallets (part type, reject code, etc. and to a Technifor impact marker for the customers pn, shift code, and julian date. Mostly I like to use AI but we had an outside vendor in here couple of weeks ago and they used RS on a station and didn't limit the descriptions to 15 characters. If I convert it to AI the descriptions get trunticated. I am just trying to understand a little more about how the strings delt with by the processor. Thanks.
  Reply With Quote
Old September 14th, 2002, 06:01 PM   #4
Allen Nelson
Member
United States

Allen Nelson is offline
 
Join Date: Apr 2002
Location: West Chester, PA
Posts: 1,368
ASCII and Strings

In the AB universe, there are two types of "string" files: A (for ASCII) and ST (for String).

Each data type is used in different ASCII instructions.

There is absolutely no difference between an A file type and an N file type. A files may be used with any instruction that an N file type is used for. The only difference that I've been able to figure is that RSLogix open A files type with the ASCII radix instead of the decimal radix.

ST files are used with ACN (Concatenate), AEX (Extract), ASC (Search), ASR (Compare), ACI / AIC (String-to-Integer, Integer-to-String) and the Channel 0 instructions (ARD (Read Buffer), ARL (Read Line), AWA (Write Append), AWT (Write).

There is a slight difference between an ST file type and an N file type. Link a T or C type, the ST is structured. Whereas T and C consist of 3 words, a single ST element is 42 words long (regardless of the data in the string).

The ST is structured with the first Word is the length of the string. The next 41 words contain the (up to) 82 chararacters in the string, in ASCII format (the same as you get when you look at an N file using the ASCII radix).

You can convert one data type to the other:

COP #ST10:0 #A11:0 41

The Length part is first, so that will go into A11:0. The string will be A11:1 to A11:41.

MOV 41 A11:0
COP #A11:0 #ST10:0 1

Will convert it back. If the string that you want to store in the ST file is not 82 characters long, put replace the 41 with your string length (less than 41, or weird things happen) in A11:0.

Like Tom said, the "number" in the String is in ASCII. If you want it be a number, you need to convert it. The ACI instruction will do that.

The individual elements of the ST data type can also be referenced directly. The length is ST10:0.LEN. The first two charactors (since each charactor is one byte, and the PLC references everything by word) is ST10:0.DATA[0], the 3rd and 4th are ST10:0.DATA[1], etc.

Again there is no difference between ST10:0.DATA[0] and A11:1 - both are single word entities.

I think that more than answers your question.
__________________
  Reply With Quote
Old September 16th, 2002, 05:02 PM   #5
Steve Meisel
Member
United States

Steve Meisel is offline
 
Steve Meisel's Avatar
 
Join Date: Jun 2002
Location: NC
Posts: 77
Thanks Tom & Allen.
  Reply With Quote
Old September 16th, 2002, 07:09 PM   #6
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,355
Another note:

If you want ot use a string address on a panelview, you can't just use the base address (i.e. ST10:0) or all you will see on the screen is a number (the length of the string). If you want to display the string itself, you need to use the reference to the first character which would be something like:

ST10:0.1 (numeral one after decimal point).

I wasted a not-small while on that one one afternoon :-(

Norm Dziedzic
Belden Machine Corp.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Problem with S7 STRING to REAL conversion RMA LIVE PLC Questions And Answers 55 October 4th, 2004 09:51 PM
String in a FIFO setup - SLC5/05 monkeyhead LIVE PLC Questions And Answers 2 September 9th, 2004 12:21 AM
GE SNP protocol CPU identifier string Pierre LIVE PLC Questions And Answers 0 February 13th, 2004 09:52 PM
Display String file on PanelView 1000 wa5yom LIVE PLC Questions And Answers 33 September 15th, 2003 10:53 AM
Help with DF1 Protocol command to retrieve N7 integer values from Micrologix 1200 PLC davidgay LIVE PLC Questions And Answers 7 June 28th, 2002 07:59 AM


All times are GMT -5. The time now is 12:46 PM.


.