How to use a GSV instruction in COMPACTlOGIX

ksa858

Member
Join Date
Jul 2014
Location
Danville
Posts
84
Hello everyone, I am new on here so please excuse my ignorance. I am doing a program conversion from RSLogix 500 to RSLogix 5000. I received an error message in RSLOGIX 5000 on a rung that says the following:
GENERATED BY TRANSLATION TOOL: WARNING: STATUS FILES DO NOT EXIST IN RSLOGIX 5000. GSV INSTRUCTIONS ARE USED IN RSLOGIX 5000 TO OBTAIN CONTROLLER INFORMATION WHERE APPLICABLE.

This is referring to a Status file bit that is used on the first pass in the program to copy a file to a location(COP instruction).

How do I replace the status file with a GSV instruction in RSLOGIX 5000? Any help would be appreciated.
 
a GSV can be used to get certain type of information about the controller such as date, time, etc.... Also depending on how its setup it can also be used to get information for devices configured in your IO config.

To answer your question what is this status file getting you information off?
 
It looks like the status file is used for Processor Mode Status/Control. After the first pass in the program the configuration data for the high speed counter module that is being used is moved from file N9 to the required location(a M0 File). I did not write this program so I am trying to figure it out. Hope this helps.
 
In the help file use the Index tab search for 'Runtime Controller And Status'. There you will see several status bits. S:FS is the 'First Scan' bit.

You probably won't have to move configuration data to the counter card, the system will do this automatically.

As far as the GSV is concerned, go to the help file entry for that instruction. Then go to the bottom. The GSV/SSV Objects details the different types of information available. Each may have its own type of structure required for the returned information. There are also programming examples. Use GSV/SSV sparingly as they really impact the scan timing.
 
Last edited:
On this rung it does show a S:FS bit in place of the original Status file bit that was used in RSLOGIX 500. So is this the actual instruction I would use?
 
Yes, that is the 'First Scan' bit.

The note you saw was informing you that OTHER types of system information, typically found in 'S' file locations in the RSLogix500 program, must be obtained using the GSV instructions. These typically ask for certain information, like the current time for instance, and require a specific type structure into which the GSV instruction places the information. Each of these types of information (the 'objects' I referred to) details exactly the type of structure needed for the information they will provide.
 
@ ksa858, correct me if im wrong, but im assuming in the original logix 500 prog you had on one rung a S:1/15 followed by a COP instruction which copies from an N file to an M0 file, which according to what you said is data for a high speed counter, you also should know what kind of data is being passed, like what does M0 mean? Keep an eye on the length of data you are copying as well. Now having said that you had a High speed counter card on the old 500 system, what is taking its place in the compact logix? is it a high speed counter card for a compact logix? if it is then try and figure out what M0 means and find that data in your new high speed counter card and on the first scan which is the (s:fs) bit use a COP instruction and move it to the equivalent of the M0 data file to your new high speed counter.
 
@dbh6, As I understand it the M0 file are data files that reside in the module. These files contain setup and control information. The old High Speed Counter(1746-HSCE)that was used in the RSLOGIX 500 is being replaced with 1769-HSC FOR RSLOGIX 5000.
 
you need to know what those setup and control information mean so you can imitate the same thing to the 1769-HSC. Since the N file is the one that copies the value to the M0 file what is writing to that N file, is it data from the HMI or some calculation in the logic that computes and stores to that N file?
 
Thanks guys for shedding some light on the subject. Looks like I've got my work cut out for me as that conversion note exists in several rungs of the project.
 
Need a GSV instruction programming example

Here are a few of the rungs I have been referring to. I am still not quite understanding how to setup the GSV instruction to replace the status file. If anyone can show me a sample it might clear things uop for me. Thanks.

RSLogix5000 rung.jpg
 
Let's analyse what is going on

A number will be used as the index of an array. The number is in N7:31. It is placed in a special sytem area - S:24. The special system area is is not needed in the CompactLogix.

A number is picked out from an array N11 using the index. This is, in effect, N11:[N7:31]

The number is converted to BCD. This is the TOD command. Because an integer could have as many as 5 BCD digits the destination is the 32 bit 'Math Register' pair S:13 and S:14. We can just use a DINT as the destination

Only the lower 4 BCD digits are retained. This was done by moving just S:13 into N7:32. This can be accomplished by performing an AND on your destination DINT with 16#FFFF as a value.

Finally the code zeroed the index register. This is not needed.

Much depends on the code before and after this. This is only a guess.
 
A key to this whole conversion will have to be an exact understanding of how the program functions in the original PLC. There is no 'one size fits all' answer for adjusting the code because of these conversion errors. It will depend on what the code was trying to accomplish in the original unit.
 
So if I experiment with this a little bit I would need to try the following:

1. In the INDEX REGISTER instuction the DEST could be DINT?
2. In the TOD instruction the DEST would be DINT?
3. Delete the MOV instruction and replace it with the AND instruction. Source A in the AND instruction would be S:13 and Source B would be N7:32. The destination would be DINT.
4. Delete the zero the INDEX REGISTER instruction.
 

Similar Topics

I'm trying to dig to the source of a minor "recoverable" system fault throwing a fault light on a machine that has been confusing my operator...
Replies
3
Views
79
Hello Experts ! I'm making improvement in old program with rslogix5000 v20 and L72S controller. I want getting the real system hour and there is...
Replies
9
Views
3,564
Hello all, Looking for a bit of help with a some programming I'm working on. I'm probably missing something simple. I've got a routine setup for...
Replies
0
Views
1,121
Hello everyone, I am having an issue with random I/O faults on a ControlNet network. In the logic, there is a GSV instruction with LedStatus as...
Replies
3
Views
5,357
Hi, I would like to know if using too many GSV instruction in a continous routine for a 1756 Control logix would be an issue. I know it is not...
Replies
6
Views
5,516
Back
Top Bottom