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 October 16th, 2008, 03:09 AM   #1
Zhopa
Member
Canada

Zhopa is offline
 
Join Date: Oct 2008
Location: SW Ontario
Posts: 7
FIFO for 2 dimensional array in RSLogix 5000

Hi everybody!

I'm struggling with 2 dimensional array. The task is simple: to keep records for last 10 user log-ins (user ID# and time stamp).

So I created array User_Stamp (DINT[7]) where I put User_ID# to element [0] and date_time_stamp to next 6 elements (discarding ms).

Now I'm trying to move this stamp to array Login_History (DINT[10,7]) and shifting data somehow.

I found nice solution for one dimensional array but stuck on two...

Any ideas?

Thanks!
  Reply With Quote
Old October 16th, 2008, 03:43 AM   #2
Gerry
Member
New Zealand

Gerry is offline
 
Join Date: Jun 2002
Location: Auckland
Posts: 1,134
Make User_Stamp a UDT instead of an array and then create a single dimension array of type "User_Stamp".
  Reply With Quote
Old October 16th, 2008, 07:00 AM   #3
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 3,639
Quote:
Originally Posted by Gerry
Make User_Stamp a UDT instead of an array and then create a single dimension array of type "User_Stamp".
That's the answer right there.
I use a 500 element array of UDT's here for queuing process alarm and flaw tracking. The UDT is defined up with about 20 elements, including string's, and the array of them works perfectly with FIFO's.
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Old October 16th, 2008, 10:27 AM   #4
Zhopa
Member
Canada

Zhopa is offline
 
Join Date: Oct 2008
Location: SW Ontario
Posts: 7
Thanks,

I felt that there should be some solution like this

But now I have another question:
how do I display this data on PanelView Plus? I mean I can not use UDT in PanelView, so how do I display elements of my array (User_ID# and date_time)?

Thanks again
  Reply With Quote
Old October 16th, 2008, 11:49 AM   #5
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 3,639
Why can't you display elements of a UDT on a PanelView Plus?
I do all the time.
[IO_SVR_TOPIC]MyUDT.MyFirstElement
[IO_SVR_Topic]MyUDT.MyThirdElement
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Old October 16th, 2008, 12:01 PM   #6
Zhopa
Member
Canada

Zhopa is offline
 
Join Date: Oct 2008
Location: SW Ontario
Posts: 7
Do I have to define EACH element in PanelView?

Thanks for such quick reply!

It's not because I'm stupid, it's because my boss is mean - no money for professional training...

Sorry to bug you again, but the last question:

do I have to define tag in Panelview to to EACH element of the UDT or there is some shorter way and I just don't see it?

Thanks again!
  Reply With Quote
Old October 16th, 2008, 12:09 PM   #7
widelto
Member
Colombia

widelto is offline
 
widelto's Avatar
 
Join Date: Jul 2005
Location: barranquilla
Posts: 1,446
Zhopa:

First picture is my udt, it is in spanish but basically is, year,month,day.hour,minute, second,etc., this is the first element of the fifo[0]



Second picture is the final result, as you can see it shows 15 results, this is the size of my fifo.

__________________
My two cents.

Last edited by widelto; October 16th, 2008 at 12:12 PM.
  Reply With Quote
Old October 16th, 2008, 01:16 PM   #8
Zhopa
Member
Canada

Zhopa is offline
 
Join Date: Oct 2008
Location: SW Ontario
Posts: 7
Thanks,
it's exactly what I need, but my question is:

in PanelView, did you create separate tag for each readout:
13 items in each line and 15 lines, so it's 195 tags?

Or is there way to create an array in PanelView Plus?

Thanks!
  Reply With Quote
Old October 16th, 2008, 01:25 PM   #9
widelto
Member
Colombia

widelto is offline
 
widelto's Avatar
 
Join Date: Jul 2005
Location: barranquilla
Posts: 1,446
Zhopa:

Look at muy udt carefully, as i said this is the first element of my fifo i.e. [0]
The first line of second image ( element [0] of my fifo) is shown in the next lines, it is a text with embeded variables, and as you can see embedded variables are the data from first element of my fifo, this is what you have to write down in your text in order to appear as in the second picture. Spaces are included just to look fine. Use my example and compare it to yours.

/*N:2 [Delta5]Prod_Mensual[15].dia ZEROFILL DP:0*///*N:2 [Delta5]Prod_Mensual[15].mes ZEROFILL DP:0*///*N:4 [Delta5]Prod_Mensual[15].year ZEROFILL DP:0*/ /*N:2 [Delta5]Prod_Mensual[15].hora ZEROFILL DP:0*/:/*N:2 [Delta5]Prod_Mensual[15].minutos ZEROFILL DP:0*/ /*N:7 [Delta5]Prod_Mensual[15].Entrada_Aceite_Ayer ZEROFILL DP:3*/ /*N:11 [Delta5]Prod_Mensual[15].Acumulador_Entrada ZEROFILL DP:3*/ /*N:8 [Delta5]Prod_Mensual[15].Salida_Aceite_Ayer ZEROFILL DP:3*/ /*N:10 [Delta5]Prod_Mensual[15].Acumulador_Salida ZEROFILL DP:3*/
__________________
My two cents.
  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
Rockwell Allen Bradley Programming Software, RSLogix 5, RSLogix 500, RS Linx, RSLogix vvcd LIVE PLC Questions And Answers 21 September 24th, 2009 10:04 PM
Array element shifting for RSLogix 5000 crazylizz LIVE PLC Questions And Answers 5 October 9th, 2007 10:11 AM
Index String Array in RSLogix 5000 rta53 LIVE PLC Questions And Answers 5 April 23rd, 2007 05:47 PM
RSLogix 5000 array tags (I/O points) Vuli LIVE PLC Questions And Answers 2 May 4th, 2006 10:14 AM
RSLogix 5000 V15 Features Samneggs LIVE PLC Questions And Answers 18 April 20th, 2006 05:45 PM


All times are GMT -5. The time now is 01:58 AM.


.