I’m trying to read a text file in a mapped network drive named Z:. I altered the Ignition.conf file to configure the network drive. When I reviewed the wrapper logs to see if it connected successfully, I saw this so it seems it worked.
INFO | wrapper | 2020/01/14 14:36:44 | Attempting to map the "\\10.10.0.117\upsTagInfo" share to "Z:"...
INFO | wrapper | 2020/01/14 14:36:44 | Mapped "Z:".
Whenever I run this script to read the file and write it to a tag, it fails
Uncomment the wrapper debugging line in the config file then start and stop again. Then after the gateway starts back up, check the logs in the gateway webpage under Diagnostics > Logs.
# Enables Debug output from the Wrapper.
wrapper.debug=TRUE
wrapper | Attempting to map the "\\fileserver\folder" share to "S:"...
wrapper | Unable to map "S:". Attempt #1 (The network name cannot be found. (0x43))
wrapper | Attempting to map the "\\fileserver\folder" share to "S:"...
wrapper | Unable to map "S:". Trying to continue. (The network name cannot be found. (0x43))
I'm not 100% sure tbh. this the first in the script being called:
def Read_CSV_File(filePath):
rows=
listDict=
import csv
try:
with open(filePath,"r") as csvFile:
csvData= csv.DictReader(csvFile,header)
for row in csvData:
listDict.append(row)
return listDict
except:
Error("Failed to read Item Master CSV")
The wrapper config maps a drive to Ignition on the gateway. So for it to work the script must be called in a gateway scope ie tag change script, gateway event script...
Remove the try except so you can get the backtrace when it fails, which will be in gateway logs.
I think this happens when you map a network drive on the gateway computer as X: then map it with ignition using the same X letter. I think I've done this myself, but it still works.