Using Hyperlinked RSLINX Values in Script

J

jtgoodman

I have an application where I trap Allen Bradley PLC5 registers when
machine faults using hyperlinks to a Excel spreadsheet. I have this PL
networked to my PC using RSLINX. I am able to look at only the las
occurrence. I would like to save the Excel spreadsheet for eac
occurrence.

So far I have been able to hyperlink the PLC register into the Exce
spreadsheet and have been able to break this info down into bits usin
Excel commands. I would like to automate this process using scrip
programming that looks at a single register in the PLC, N12:154, and i
this register is not zero, archive the fault spreadsheet as:

Fault(number from N12:154) YYYYMMDDHHmmss.XLS

I have already figured out how to extract the date stamp informatio
using script commands.

The fault file will automatically point out what caused the specifi
fault with a section for each specific fault number. This will hel
tremendously help mechanics in troubleshooting problems with thi
complicated machine.

The problem that I currently have is that when I try to extract th
fault register information hyperlinked to cell “M1” from m
spreadsheet, “Get Fault Value.XLS”, I get an error

“Type Mismatch”

This is for the command

CstrFaultNumber = objSheet.Range(“M1”).Value

This command works fine for any numeric or text cell, but I get thi
error for the hyperlinked cell, which has in it

{=RSLINX|KONICA!`N12:154,L1,C1`}

I have tried to use the script hyperlink command setting

CstrFaultNumber = {RSLINX|KONICA!`N12:154,L1,C1`}

But this hangs up on the : (colon) character. All the examples I fin
use the word HYPERLINK in this command. I have tried that and i
doesn’t work. Unfortunately all my searching on the network has no
turned up anything specific on how to use this hyperlinked informatio
from an Allen Bradley PLC5. I get it into Excel by using the “inser
hyperlink” hotkey and the clicking on the cell in a live RSLINX table
The Excel spreadsheet works fine. I would just like to write a progra
to save the fault file when it happens for troubleshooting purposes
The register N12:154 goes back to zero when the fault is cleared. Th
fault must be cleared for the machine to go on working. If anothe
fault happens the trap registers in the PLC are overwritten, prio
fault information is lost, so I would like to save this file each tim
a fault occurs. I would have my script program looping and triggerin
off N12:154 not equaling zero and save all faults traps when the
occur.

Any suggestions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top