3 Replies Latest reply on Mar 21, 2012 2:32 AM by mbraendle

    Simultaneous scripts


      I've searched for an answer but without success ... does anyone know if it's possible to run a number of scripts simultaneously? I have a situation where I need to process about 11 bytes of data at a time and I need to do this as quickly as possible. Up to now I've been processing each byte sequentially, but I wonder if it's possible to process all the bytes at the same time. If it is possible, can anyone suggest the best way I might be able to do this?

      Many thanks


        • 1. Re: Simultaneous scripts
          Stephen Huston

          My understanding is that in FileMaker, scripts called at the same time actually stack, and run in the order called. This is why calling subscripts will let the subscript run before resuming the original script which called it.


          The stacking order indicates that there is really no such thing as at the same time. It is possible that different users may simultaneously call scripts, but those are executed on each client machine, and each user has their own stacking order.


          Server-side scripts can be scheduled to run simultaneously, but that just means they all have the same beginning time, they still get called in some order and stack.


          • 11 bytes ain't a lot. What are you actually trying to do in FileMaker that needs to be speeded up?
          • 2. Re: Simultaneous scripts

            Hi Stephen.

            Thanks for the reply. Your comments are identical to how I had previously thought the process would work. I will be developing the system for use as a standalone runtime, so only one FM Pro client will be accessing the device at one time, and all the communications will be done down one USB cable running as RS232.

            I agree that 11 bytes is not a lot to process, but things are complicated somewhat: most, if not all the processing is done at the bitwise level. Then the data is converted back to hex and finally a checksum byte is calculated and nine bytes are sent back to the device in response. Oh, and this cycle will be repeated about 80 times a second.

            I've managed to prototype the app in FileMaker but it's clear that all the conversion from hex to bits and back again is slowing things down. I've looked at using Real Basic because it provides native bytewise and bitwise methods, but I'll have to learn Real Basic from scratch again (it's changed hugely since I last looked at it more than 10 years ago.)


            • 3. Re: Simultaneous scripts

              Just wondering: What role has FileMaker in the whole setup? Does it need to do data processing, or just store the data?


              You could let the communication software collect the data and then import the data into FileMaker in batches.


              As an alternative to RealBasic, have also a look at the Processing language  (www.processing.org  and http://www.processing.org/reference/ , see bitwise operators there), which includes a Serial library (http://www.processing.org/reference/libraries/serial/index.html) for communication over RS-232. Processing is based on Java. Using the Processing Developing Environment, one can create either an executable, or even a .jar file which in principle could be loaded by the ScriptMaster plugin.