Mar-08-2024, 08:35 AM
real_Time_Sinu_V5.py (Size: 7.06 KB / Downloads: 27)
I am not from coding background but currently am coding using python due to job requirements.
I have attached the code with which I need help with. The basics of the code is that I am trying to read and write data from some electronic sensors using some data acquisition systems (DAQ).
These are what I am trying to achieve using this code:
1. Read an external .csv/.txt file containing these following column names (Disp, Voltage 1, Voltage 2, Logic). This is then saved as a data frame.
2. A displacement value is then read from a daq and is then checked against the Disp value in the data frame. The comparison is based on the Logic column which is either <= or >=. The check will occur row by row for the input data frame.
3. please keep in mind that once a line/row is checked in the data frame it should not be checked again.
4. when the logical check returns false the Voltage values (Voltage 1 and Voltage 2) are returned as outputs. i.e if my read displacement is checked at the ith line that it is not <= the Disp value in the ith line then my output will be Voltage 1 and Voltage 2 from (i-1)th line.
5. this check will go for the length of the data frame.
6. Once the full check across the data frame is done it is considered a cycle completion.
7. The whole loop needs to run for as long as cycle number <= max number of cycles (which is a user defined input declared previously).
Will be greatly indebted if I can get a solution to this dilemma. As as per my attached code the checking of read displacement with the Disp value in the data frame is not occurring correctly