Script functions questions

Hi everybody.
I need to make an OPC DA connection to a redundant pair. I have found a suitable function system.device.setDeviceHostname(DevName, HostName)
But it returns with error:“Caused by: java.lang.Exception: Device ‘CCR0’ doesn’t exist”
When I try to get device list with function “system.device.listDevices” I receive a dataset with 4 columns and 0 rows.
I defensively have divices. They are shown in web page and “[System]Gateway/OPC/Connections/” tags.

Can you tell me what is wrong?

Here is the code

[quote]PrimaryIP = “192.168.11.120” #Имя основного сервера
SecondaryIP = “192.168.11.121”#Имя резервного сервера
ConnactionName = “CCR0” #Имя подключения
val = system.opc.getServerState(ConnactionName);#Текущее состояние подключения
if val != u’CONNECTED’:#Если НЕ подключено, то выключаем соеденение, переключаем контент и включаем соединение
print "Device " + ConnactionName + "connaction status = " + val
RedundanceStatus = system.tag.read(“conf/Redundancy/” + ConnactionName)
if RedundanceStatus:#Состояние резервированя
print “Redundance state is PRIMARY”
print “Switching OFF the " + ConnactionName + " device”
system.device.setDeviceEnabled(ConnactionName, 0)#Выключаем устройсво
#SLEEP 5000
system.device.setDeviceHostname(ConnactionName,SecondaryIP)#Меняем IP на устройстве
#SLEEP 5000
system.device.setDeviceEnabled(ConnactionName, 1)#Включаем устройсво
#SLEEP 15000
else:
print “Redundance state is SECONDARY”[/quote]

setDeviceHostname and listDevices are functions for modifying and listing devices on Ignition’s OPC-UA server. They don’t have anything to do with creating a new OPC DA connection. There are no scripting functions for that.

Thanks, That is too bad.