EXCEL Recording From DDE

Kabir

Member
Join Date
Mar 2004
Posts
107
I had a problem where I want EXCEL to read data from RS Linx and record it at different intervals of the day and store all values.
This is what I did.
In Cell A1 Temp from plant
In a CELL B1 =now() This gives you the date and time of the day
In Cell B2 =Hour(B1) Hour number
In Cell B3 =Minute(B1) Minute Number
In Cell A2 =if(AND(B2=12,B3=0),A1,A2)
Notice that if the time is 12:00PM the date from Rslinx in A1 would be stored in A2 however when the time changed EXCEL looks back at A2 its own cell referance to get the value.
In Doing this EXCEL stores the data however you have to go to
Tools - Options - Calculations and enable Iteration

Now this is the question
Is there any way that using this repeaded calculation could affect the running of the PLC?
If this question sounds strange think about this.
When I ran the excel spreadsheet the PLC turned off all the equipment without indicating any faults.
 
Kabir,

It appears that you have an endless loop in Cell A2: A2 =IF(AND(B2=12,B3=0),A1,A2). Another name is a "Catch 22", or "dog chasing its tail". It goes around and around but doesn't do anything much except tie up your computer! It is never wise to have a cell refer to itself. The results can be unpredictable.

It is the last number in the IF statement that is causing the problem. Because the Excel If statement logic is like this: If(expression, do if expression TRUE, do if expression FALSE)

then the last A2 is the FALSE expression and not the one you are looking for, so just substitue something else there say a null value like "", or even "No Data Now!", like this:

IF(AND(B2=12,B3=0),A1,"")

Then if the AND is TRUE, A1 gets inserted into Cell A2, but if the AND is FALSE, then nothing gets put into A2.
 
Still Looking for answers

I understand all the stuff about endless loop and that however what I really want to know is could this have any affect on the running PLC?

I am not sure why as yet however when I ran the application the PLC shut down without fault.
NOTE: There are other factors that could of caused this condition on the plant. It is not clear as to what caused the PLC shut down, but the plant just restart by the operator NO Alarms were present

When I did the continuous loop in windows XP I used the help which showed that in order for it to work I had to enable Iteration (Tools Options Calculations). I am not really sure how this parameter in Excel stops or handles the infinite loop and I want to know what this parameter does.
 
Which PLC and which network type ?

I have heard that an Ethernet storm can zap AB processors with an Ethernet port.

I have also heard that too many messages can make problems (but not that it can shutdown the PLC).

You might want to check the processor major fault status words:
PLC5: Major error word S:12
SLC500: Major error word S:6, and Last Major error S:54.
 
Kabir,

If you are not writing data then you shouldn't have a problem (regardless of how Excel is operating), unless as Jesper said, you have overloaded the messaging to the processor.

The Ethernet storm that he referred to has been known to completely wipe out the processor memory on a PLC5 with an Ethernet sidecard. But you said:

PLC turned off all the equipment without indicating any faults

If either messaging was overloaded, or an Ethernet storm occurred, you should have seen a fault, so my inclination would be to look at your other sources . . .

Good luck,

Marc
 
Thanks

Thanks alot fellas I know that there should have been a fault indication the status file was also checked there was no fault after the shutdown.
The PLC is not directly connected to the LAN
Its a DH+ network thats connected to the LAN via Gateway.
I just wanted to get more information on what happened before I attempt to run the EXCEL application again. I too have heard about the storm however that results in a fault, there was no fault.
If you all cannot think of anything that would result in the PLC shutdown as a result of EXCEL or RSlinx DDE then I would try it again
Thanks alot fellas.
 
Kabir,

please tell some more before you try again.
What CPU type ?
What does "shutdown" mean ?
Does the CPU go into fault ? If so, there MUST be a fault code !
 
More Information

Shutdown - All outputs went off
There was no indication of fault or fault code, for this reason I think it was some other error that caused this problem
Its a PLC 5/30 with a Panel View 1200 two whole racks connected to DH+ then to a gateway onto the LAN
Do you need any more information?
 
So the outputs turns OFF, but the CPU continues to run ?
This could be a programming error, or a consequence of the DH+ activity in some way. Get in contact with the programmer for the PLC.

Or is the CPU shutdown (all lights go out) together with the outputs ?
If there is an EPROM but no battery, then the CPU will be set back to its original state when powering up. That means no fault codes.
 
More Information

I am the programmer
The active light on all modules remain on as well as the processor was in run mode. All that happened is the O/P's went off for no apparent reason.
 
Maybe your OPC or DDE link via RSLinx writes to the CPU in some way, and that in turn makes a problem in your program somewhere.
Try to set up read-only privileges for the DH+ channel. That will block any writes to the CPU from Excel.
Set the default class as "3" and set limited privileges for that class.
You can still go online and log on as class 1.
 

Similar Topics

Hi, I'm trying to export data from a DataGrid to Excel using VBA, but I'm getting an error "Object doesn't support this property or method". The...
Replies
0
Views
76
I don't know if this is the right place for the subject at least I'll try. The company has one of the oldest computers that is a master Windows...
Replies
5
Views
740
Hi, I'm just looking for a simple way to make a button in excel (via VBA I presume) to toggle a bit in RSLogix 5000. I just got FactoyTalkLinx...
Replies
9
Views
545
Hello, I want to send the data from Rslogix500 to Excel. I created a connection between RSlinx and Excel. The values in Excel automatically...
Replies
5
Views
1,177
Hi guys, Im back again, this time I cannot minimized excel even though i put 6 on the exec mode.. this is my cicode.. Exec("C:\Program...
Replies
1
Views
1,093
Back
Top Bottom