DiamondLightSource / dls-pmac-control

A python GUI for controlling and configuring Delta Tau turbo pmac 2 including Geobrick
Apache License 2.0
0 stars 2 forks source link

'load pmc' doesn't work for PowerPMAC #8

Open UrszulaNeuman opened 1 year ago

UrszulaNeuman commented 1 year ago

We used to be able to load files to a brick using the 'load pmc' button. This doesn't work for powerPmac. I'm guessing it is because of the tree like file structure used by powerPMAC. Once the button is pressed it would be good to see both sides - the source and the destination file structure. Similarly to e.g. WinSCP image

gilesknap commented 1 year ago

Are you trying to send PMCs or other files?

gilesknap commented 1 year ago

I believe that sending a PMC to the PowerPmac would be like typing the commands into gpascii. So it would change the state of the controller but it will not change the project files (at least not in any nice way!)

ajgdls commented 1 year ago

Yes the load button in PowerPMAC just does the same as it used to, send line by line the contents of a file into gpascii (in turbo pmac 2 it was line by line into ascii interface). You can upload/download files using the new PowerPMAC tool for project control. This will upload/download project files in the same way as the IDE.

UrszulaNeuman commented 1 year ago

Hi, I want to send various files - kinematic routines, homing routines. If the button sends a PMC line by line it is not very useful for PowerPmac. I expect this will confuse people. Maybe we should get rid of the button all together for powerPmac? What is the new PowerPMAC tool for project control? Can I use it from a Linux machine? How? Thanks, Urszula

GDYendell commented 1 year ago

I am using the load pmc... button to download a plc and a motion program on a power brick I07 and it works OK. It is infinitely easier than using the IDE - though clashes between the two is an unsolved problem as yet. As far as I know this is the best way to download files currently. We shouldn't remove the button until we have a better way.

JimboMonkey commented 1 year ago

@GDYendell - when you downloaded the PLC and motion programs, where did they end up within the filesystem of the PowerBrick?

rjwills28 commented 1 year ago

The new PowerPMAC analyse tool is called 'dls-powerpmac-analyse'. This can be used to back up, compare and restore PowerPMACs.

It can be pip installed into a Python virtual env (Python >=3.7). To install and run it at Diamond you will first need to load the python/3.7 module. Instructions below:

module load python/3.7
python -m venv path/to/venv
source path/to/venv/bin/activate
pip install --upgrade pip
pip install dls-powerpmacanalyse

Run with: dls-powerpmac-analyse -g

Help: dls-powerpmac-analyse -h

GDYendell commented 1 year ago

when you downloaded the PLC and motion programs, where did they end up within the filesystem of the PowerBrick?

I am not sure, but they appeared with, e.g., list prog 1 and worked so I was happy. I can do some digging and see if I can find them on the filesystem.

GDYendell commented 1 year ago

OK I think I see what happens. If you download a file it does take effect, but even doing a save does not make it persistent. It does not overwrite (e.g.) /opt/ppmac/usrflash/Project/PMAC\ Script\ Language/Motion\ Programs/prog1_filter_move.pmc. Would it be possible for pmac-control to write it to that directory as well as what it does currently?

JimboMonkey commented 1 year ago

Urszula and I were discussing this yesterday. We think, to keep the motion area and controllers in sync and allow easier comparisons between the two, that files should be uploaded to their allocated place in the controller's filesystem, and then activated in the 'live' area of the controller. This is why Urszula's suggestion of a source/destination dialog box may be needed.

A discussion point about how uploads should be handled is on the agenda for the next motion controls meeting (Weds 5th) - please come along to join in

gilesknap commented 1 year ago

In my opinion the PowerPMAC can only be used in one of two ways:

Trying to mix the above two approaches is certainly unsupported and full of major pitfalls. I strongly advise against it.

I enclose my investigation notes into this issue from a few years ago. SUMMARY: the life-cycle of configuration files for PowerPMAC is complex and this is very unlikely to be fixed. Trying to work around it is unsupported and too fragile to be practical.

hgv27681-PowerPmacIDEInvestigation-031022-1043-120.pdf

@rjwills28 I think you have a reasonable amount of experience of this, I'd be interested to know if you agree with the above?

rjwills28 commented 1 year ago

Yes I do agree that mixing approaches could cause issues. The dls-powerpmac-analyse tool was built to mimic what the IDE does in terms of managing the file system and so is also a safe way of downloading programs to a PowerPMAC.

gilesknap commented 1 year ago

Thanks @rjwills28. That implies that there is a way of doing things outside of the IDE as long as we work in the same way as dls-powerpmac-analyse. Can you briefly elaborate on what process it uses? Thanks.

ajgdls commented 1 year ago

@gilesknap the powerpmac-analyse tool is fine as long as you are very careful. It can perform the same functions as the IDE (Phillip Coles was careful to match the functionality of certain commands) but there can still be conflict if you use both the IDE and the tool. DLS have still not arrived at a confirmed set of procedures for these tools playing together well on the PowerPMAC. The main point is that the pmac control tool can be used for quick tests of PLC / motion programs using the download button, but those files then need to be correctly injected into a project if they are to be handled appropriately when the IDE is used.

ajgdls commented 1 year ago

I'm voting that the pmac control tool should be left as it is - it would be far too brittle to allow this tool to start downloading files into the file system of the PowerPMAC unless everyone at DLS (including motion team) are signed up to doing it in this specific way.