Tic Controller 0x01 flag values question

Hi it’s me again,

So I am at a point where I am trying to look at the status flags on each of 8 Tic controllers. I am using the serial code example shown on your website HERE .

I am using another function that calls that function and reads the bytearray output, converts it to a string and writes it to an html formatted text file
def get_all_status_flags(self):
b = self.get_variables(0x01, 8)
lstb = list(b)
error_flag = str(lstb)
return error_flag

function to write errorStatus file:

def errorStatus(self):
dataFile = ‘/var/www/html/Pantex/errorStatus.xml’
flag = tic.get_position_uncertain_flag()
if axis == 1:
f = open(dataFile, ‘w’)
f.write("" + “\n”)
f.write(" " + “\n”)
f.write(" axis" + str(axis) + “\n”)
f.write(" " + flag + “\n”)
f.write(" " + “\n”)
f.flush()
f.close()

Each Tic is called sequentially axis1, axis2, axis3…axis8 so I can see the flag values for each Tic Controller while they are are running. I “expected” something like: [1,0,0,1,0,0,0,0] , but I am getting rather different results.

In this particular run, all the axes were set with reverse limit switches (wired NC), on 1,2,3,4 had limit switches connected, 5,6,7,8 limit switches are not connected, so would appear as if the home limit switch was activated.
So I believe the first bit (0) reads 1 when running, except the 9 must mean a limit switch has been hit, bit 3 is showing 128 on all, this (I am guessing) means the limit switch is wired for reverse, not forward.

Anyway, is there a table that shows how to interpret the values. I’ve not seen it in the Tic user’s guide. If I understand teh method, I can see it being a powerful debug/error and status tool.

Thanks,
John

Hello, John.

The “Variable reference” section of the Tic user’s guide that you linked to is the table that describes those values. What flags are you trying to read? It looks like you are reading 8 bytes of data, when I suspect you are only interested in 1 byte. If you are only interested in the “Misc flags1” bits, you should use get_variables(0x01, 1) instead of get_variables(0x01, 8), and look at the bits of the returned byte.

If that does not address your problem, can you post the simplest complete version of your code that demonstrates the problem as well as the output you get?

Brandon

Hi Brandon,

I altered the code and I can see the bit values add up, as I expected, so it was just an issue misinterpretation of the variable reference in the tic user guide. It makes sense and I should have seen that.

Thanks,
John

1 Like