mattwach / fygen

fygen is a Python library for Feeltech Signal Generators (FY2300, FY6600, FY6800, FY6900 and more)
GNU Lesser General Public License v2.1
79 stars 23 forks source link

Sending malformed waveforms makes fy6900 unresponsive #3

Open puterboy opened 3 years ago

puterboy commented 3 years ago

I was playing around with custom waveforms for my fy6900.

I tried:

fy.set_waveform(1, values=[1,2,3,4,5,6,7,8,8,8,8,8,8,7,6,5,4,3,2,1], value_count=20) RMW -> 0 RFW -> 0 DDS_WAVE1 -> W (Wave Data) -> Traceback (most recent call last): File "", line 1, in File "/home/pi/jjk/fygen/fygen-master/fygen.py", line 641, in set_waveform raise CommandNotAcknowledgedError('DDS_WAVE data was not accepted') fygen.CommandNotAcknowledgedError: DDS_WAVE data was not accepted

After this error, the fy6900 became unresponsive to any more remote commands -- though I could still access it locally from the physical buttons. To recover, I had to cycle the power on the fy6900.

Any idea what may be happening? Is there a way to restart the fy6900 remotely if this happens again (rather than having to run down several flights of stairs to the basement)

mattwach commented 3 years ago

I have the FY2300 and it needs an array size of exactly 8192 values. I would think the FY6900 is similar. It's probably hanging because it's waiting for more data.

puterboy commented 3 years ago

That makes sense. In case someone does make such a mistake, is there a way to reset remotely or at least complete the load... or at least put a warning in the code not to allow values other than 8192? mattwach wrote at about 00:01:55 -0800 on Wednesday, December 30, 2020:

I have the FY2300 and it needs an array size of exactly 8192 values. I would think the FY6900 is similar. It's probably hanging because it's waiting for more data.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/mattwach/fygen/issues/3#issuecomment-752366496

mattwach commented 3 years ago

It's in the main docs here:

https://github.com/mattwach/fygen#custom-waveforms

The code uses value_count as a general protection.:

https://github.com/mattwach/fygen/blob/master/fygen.py#L599 https://github.com/mattwach/fygen/blob/master/fygen.py#L613

For the FY2300 and FY6900 we would just leave value_count at it's default value of 8192.

but I can't guarantee that every signal generator model needs 8192 points. I think there are some older generators that take 2048, for example and future ones might need more than 8192.