error in retrieving controller time

rejoe.koshy

Member
Join Date
Dec 2011
Location
kolkata
Posts
195
hi guys,
I have been trying to retrieve the conroller time using a GSV instruction.I have defined the type of the destination tag DINT[7].When I verify the routine it gives me a error " missing reference to array element"..
I am using class name- wallclock time & attribute name- datetime.

What could be possibility for thi kind of a error?
 
Make the destination address the first element of the DINT[7] array, like "MyClockTime[0]" rather than the name of the entire array "MyClockTime".
 
It is of course possible to GSV the data into any array location. For example the clock data might be needed at locations 10 to 16 of an array, so you could specify Array[10] as the destination.

however if you just want the clock data to use in the code, a cleaner solution is to make a UDT that is exactly the same size as the DINT[7] array you are using. The member names of the UDT, (which I've called DateTime as an example), can be matched to the GSV data.....

DateTime.Year DINT
DateTime.Month DINT
DateTime.Day DINT
DateTime.Hour DINT
DateTime.Minute DINT
DateTime.Second DINT
DateTime.uSeconds DINT

Now create a tag of the DateTime UDT - e.g. PLC_Clock

Now your destination for your GSV can point to DateTime.Year

The GSV will not mind the destination being a UDT with named DINT members.
 
ken,
Thanks for the help. It worked,but was there anything technically incorrect in what I did??

Yes there was, which is why it didn't work !

You didn't specify the starting element of the array as your destination - just the array name itself. The GSV requires that you set the destination as a single element of an array.

If you used an array, the destination as Ken said should be first element in the array to start copying the data into.

If you used the UDT idea I posted, you will notice that I said the destination for the GSV should be DateTime.Year, the first member of the UDT.
 

Similar Topics

Hi, On the project i'm working on i'd like to connect Labview to an OPC-UA server on a B&R X20CP3586. After the configuration of the B&R, i...
Replies
3
Views
3,626
Hi, First time user of S5 Siemens. Is there any solution on how to solve this kind of error. HMI OP7 $613 DB-error No. 11 (0: 15) Siemens PLC...
Replies
9
Views
157
I am kind of new to GE products, but we have several in my area. I made a minor logic change and it verified good, but when I tried to download I...
Replies
5
Views
48
Hi, I'm currently having issued with a PowerFlex 252. It was working fine last week, and suddenly decided to stop working. When I go into...
Replies
2
Views
137
Hi there, I'm new to plc programming and was wondering why I get this error code when I run my simulation for these temperature sensors? What I'm...
Replies
2
Views
106
Back
Top Bottom