Author Topic: Canon Basic scripting (DIGIC 6, DIGIC 7 models)  (Read 1251 times)

kitor

  • Developer
  • Senior
  • *****
  • Posts: 350
Canon Basic scripting (DIGIC 6, DIGIC 7 models)
« on: November 27, 2021, 02:43:36 PM »
... there's Basic interpreter on Digic 6 and 7 models too! (checked on 750D, 5D4, 200D). It works differently than D8+, so I'm creating a separate thread.

There's no need for script.req file on card, or any bootsector flags.

I found no way to execute script without UART. With UART:

Code: [Select]
' Comment test, will this be ignored?

public sub my_test(string)
    ' moar comments
    Printf("\nyo man!\n")
end sub

Code: [Select]
K393[1]>LoadScript B:/test.m
 Load B:/test.m
 LoadScript returned 0(0x0)
K393[1]>ShowScript
 Show Script
                          Name:     Code: CodeSize:     Data: DataSize:
 ======================================================================
                      B:/test.m  0x9ac3cc      0x28  0x9ac400      0x14
 ----------------------------------------------------------------------
 ShowScript returned 0(0x0)
K393[1]>my_test
yo man!

 my_test returned 0(0x0)

Quirks: I found no way to auto execute any function from script. All public subroutines get exported into Evprocs.
If subroutine doesn't have any arguments, parser complains:
Code: [Select]
K393[1]>LoadScript B:/test.m
 Load B:/test.m
Syntax Error:Invalid Parameter Name
3:private sub my_test()

 LoadScript returned 1(0x1)

Thanks to Lorenzo for pointing me into that direction. He claimed that there may be Basic engine on 6D, unfortunately this is not yet confirmed/busted. autoexec.sc on D5 is something with different syntax.
Too many Canon cameras.

srsa

  • Developer
  • New to the forum
  • *****
  • Posts: 48
Re: Canon Basic scripting (DIGIC 6, DIGIC 7 models)
« Reply #1 on: February 07, 2022, 12:05:39 AM »
This could possibly be used over PTP (for creating event procedures). See this for details.

kitor

  • Developer
  • Senior
  • *****
  • Posts: 350
Re: Canon Basic scripting (DIGIC 6, DIGIC 7 models)
« Reply #2 on: February 07, 2022, 09:29:07 AM »
Yes, most likely.

There's yet another scripting language on D6+ but I still have no idea how to execute it without running own code just to do that.

File is AUTOSHT.SEQ, syntax seems pretty simple - allows for shoot automation, but parser also has option to call (probably arbitrary) evprocs from script.

File load is done by SVDSTask; task is created by one of states of SVDSState which is part of ShootVfxDebug class, which is one of handlers (stages?) for ShootVfxService (SVS).
Seems that state transition can be executed calling PostStageEvent wrapper specific for SVDS, or via event delivered through ShootVfs StageClass (event callback routes messages to selected stage).

If we find a way to execute this on camera I'll make a separate thread.
Too many Canon cameras.