Shawn

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Shawn

  1. Thank you, I tried the 1st option where I replaced "c:\junk" with Registry.strPathToDtStoFlds. This registry path is one folder higher than the actual data folder. This Registry variable allows the DF program to locate the "Boeing Data" folder anywhere on the individual's PC. There are other mechanisms to ensure the "Boeing Data" folder is connected to Registry.strPathToDtStoFlds, so reassigning the logger to one path lower from "Registry strPathToDtStoFlds\Boeing Data" is guaranteed to exist. Private String oldname = logging.BoeingData.strFileName Logging.BoeingData.strFileName = Registry.strPathToDtStoFlds // put something else here Private String newname = left(oldname, getlength(oldname) - 4) + " -Reset.csv" File.rename(oldname, newname) Unfortunately, the code did not work. In the Command/Alert window, I saw the following issues: 1) C1086 One of the parameters was empty: ClearHistory Line 3 - Uncaught error in sequence ClearHistory 09/14/22 23:58:14.780 2) F0011 SHARE.EXE was not loaded, or a shared region was locked.: Startup Line 37 - Uncaught error in sequence Startup 09/14/22 23:58:30.094 For 1) may be the sequences in the reset button don't happen in the correct order using the two Start/Stop Sequences for A) ClearHistory then B). to run the initialization "startup" sequence where this code is placed. This logger path change may have caused the "ClearHistory" sequence not to function even though it should have run first from the DF virtual reset button? For 2) I don't know, but the file was not renamed in the oldname = logging.BoeingData.strFileName logged location. Do you have any other suggestions. Shawn
  2. Hello Representative, I have a question regarding "File.Rename(oldname,newname): renames the oldname file to newname" and how to use it. If the DF program's virtual reset button is selected, I would like to rename the logger CSV file from "FileName.CSV" to "FileName -Reset.CSV," where the file name is actually "FilePath+FileName.CSV." Logging.BoeingData.strFileName = Registry.strPathToDtStoFlds + "\Boeing Data\FVSMdata_" + component.SerNum.strText + "_" + MyStringVariable + ".csv" Registry.strPathToDtStoFlds = "C:\MyBriefcase\Desktop" component.SerNum.strText = <XXXXX> unit serial number MyStringVariable = formatdatetime("%y%m%d_%H%M%S",StartTime) where StartTime = systime() When a logged file is cut off from a reset, I would like to rename the file as follows: Example: "FileName.CSV" = FVSMdata_00175_220914_223506.csv to "FileName -Reset.CSV" = FVSMdata_00175_220914_223506 -Reset.csv taking the "FilePath" into account. The file may have been cut off but may have some relevant data. Thank you, Shawn
  3. Shawn

    Shawn

    Hello, I have a question regarding the logging of data to a CSV file. I have a simple program logging Modbus registers using the Channel Table. Whenever I log new data, I end up with a data stub from my previous test. This rogue chunk varies in size but appears at the beginning of my new CSV file. It is quite apparent when I change the XL General Time value to Custom (m/d/yyyy h:mm:ss.000) format. The channel table is free running, so clearing all history is short-lived. How can I prevent this old data chunk from ending up in my new CSV file? Thank you, Shawn
  4. I appreciate your help. Now I see that it is straightforward and that I do not need to use the channel tables to repopulate a 2D graph. Thanks again, Shawn
  5. Hello, I require help. I want to graph, in DAQFactory, existing data that DAQF collected in the past, logged as a CSV file. I want to load the data into the two (2) data channel tables named "mV" and "PV" with the corresponding DateTime stamp. This DT-Stamp was recorded "in XL format", i.g., "44693.39602" (General Fmt in Excel viewed CSV) or if saved as an XL file can be represented in a custom format as "5/12/2022 9:30:16 AM" (=TEXT(44693.3960185185, "m/d/yyyy h:mm:ss.000")). The timing is asynchronous, so I want to move the exact DateTime stamp to each channel table and each trend value. I have reviewed the use of: Var.FileHandle = File.Open("C:\MyBriefcase\Desktop\Boeing Data\FVSMdata_05007_220512_0932.csv",1,0,0,1) Var.strIn = File.ReadDelim(FileHandle,-1,",",Chr(10),0,1) //Looping code "For(Var.x = NoRsNoH, x>0, x--) ... Endfor" - Skip header when loading channel tables, load Channel Tables backwards for DAQFactory (FILO) as the 0th element is the most recent, NoRsNoH = Number of CSV Rows No Header included File.Close(FileHandle) ----------------------------------------------- strln = {{"TheTime","mV","PV"},{44693.39601,5377808,0}, ... {44693.40212,1450.296,1432.906}} where this can be represented by {Var.strIn[0][0,2], Var.strIn[1][0,2], ... Var.strIn[NoRsNoH-1][0,2]} I can fill the "mV" and "PV" tables with the inverted list of values but I am stuck with the current DateTime Stamping when I want the exact historic stamps. The User Guide suggests using the function "InsertTime(Value, Start, Increment)" but it is unclear how to use this with "MyChannel(mV/PV).AddValue(Value=Var.strIn[x][1/2]) and convert the XL time stamp back to DAQFactory format ( formatDateTIme("%Y%m%d%H%M%S.xxx", timeStamp)?) Also, how do you get the channel tables to graph? When I load the values to the undesirable "current time," my graphs don't materialize on the 2D Graph Component like when the data is added to the mV/PV channels via Modbus using a communications module. Thank you.