Hello,
I am designing a strategy that involves some data logging, using PAC Sim until my hardware is ready. I am trying to use PAC Control to carry out the logging and currently am getting an error status -407 when I attempt to open the communication handle with the OptoScript below:
//Generate data log string to append to file
iDataLogLength = GetLengthOfTable(DataLogVars);
sTransmitDataRow ="";
for nDataLogIndex = 0 to iDataLogLength-1 step 1
FloatToString(fDataLogtable[nDataLogIndex],8,3,sDataPlaceholder);
sTransmitDataRow=sTransmitDataRow+sDataPlaceholder+",";
next
//Open communication handle
SetCommunicationHandleValue("file:a,~/datalog.csv",DataLogHandle);
comstatus = OpenOutgoingCommunication(DataLogHandle);
if (comstatus==0) then
//SetEndOfMessageTerminator(DataLogHandle, CHR(10));
comstatus=TransmitString(sTransmitDataRow,DataLogHandle);
comstatus = CloseCommunication(DataLogHandle);
endif
Digging around the forums, this error code is due to an unavailable file for PAC Sim to read. (see here)
I tried to look for my PAC Sim install in C:\Windows\system32\OptoCom but it is not present there. The forum posts are somewhat old so I am not sure if the installation directory for PAC Sim has been changed. I have no problem running all of my strategy so I expect PAC Sim to be running fine somewhere in my computer. I checked the SysWOW64 directory and could not find an OptoCom directory either. Furthermore, the PAC Control documentation suggests that the communicatiion handle should create any directories that are not present when the comm handle is open: “a — Opens a file for writing at the end of the file (appending). If the file doesn’t exist, it is created.” (pg 280 of PAC Control users guide).
Any suggestions on how to further troubleshoot the issue would be welcome.
Thanks,
Juan