Page 1 of 2

4d Display Visi serial commands interface

Posted: Wed Aug 14, 2013 7:18 pm
by Afsal
Hello,

First of all thank you for the amazing FCV6 beta, However I did not seen any option for 4d Display Visi serial commands interface.

For your reference please note the amazing feature with Arduino.
http://www.youtube.com/watch?v=L1TPs6dI11k



:D :D

Hopefully

Afsal

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 14, 2013 7:21 pm
by dazz
Hi
I havent got a 4d display, but Flowcode has its own macros for touchscreen etc
you could put it in feature requests and wait for one of the MM staff to anwer :)
Regards
Dazz

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 14, 2013 10:14 pm
by acestu
Hi Afsal,

If you have one of these displays, you can add your sliders, switches, gauges etc in Visi Genie and when you have what you want, build the project and then in the tools menu open GTX and you can test your display and get all the serial commands that it uses, that is sent and received, you can then set up a serial comms with your chosen micro.

I am looking to make a custom component in FC6 for my displays but I think it will be a little difficult as every custom display project would use different accessories, I am still thinking of a way to do it really...

cheers
Acestu

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 14, 2013 10:27 pm
by JonnyW
Hi Acestu.

The component creator and other features are pretty extensive in v6. I don't know the extent of your customisation but if you want help using the component creator and using properties to customise your component, let us know and we will do what we can to help. Remember all the components and demos in FCv6 are written in Flowcode as flowcharts, so anything you can see and use there is possible.

Jonny

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 14, 2013 10:32 pm
by acestu
Hi Johny,

Thanks for the offer, I have only had about 2 hours on the Beta but I will certainly be looking at this in the next few days, I have a few 4d displays here for testing....

Also anybody else interested here is the serial command set for the Picaso Displays:

http://www.4dsystems.com.au/downloads/S ... EV1.12.pdf


Cheers
Acestu :D

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 14, 2013 11:43 pm
by acestu
Hi,

4d Systems have a GIT Repository with several Libraries for the Inteligent Displays inc Arduino, Raspberry Pi and C , I think the C Library would make a FC6 component easier rather than the raw serial commands.

Here is a link to the Libraries:

https://github.com/4dsystems?tab=repositories


cheers
Acestu

Re: 4d Display Visi serial commands interface

Posted: Thu Aug 15, 2013 10:58 pm
by Afsal
hello,

Please provide some tutorial how to make own FC component for 4D 4.3 inch display serial interface











thanks

Afsal

Re: 4d Display Visi serial commands interface

Posted: Thu Aug 15, 2013 11:11 pm
by acestu
Hi Afsal,

Jonny has offered to help make a custom component:

JonnyW wrote:Hi Acestu.

The component creator and other features are pretty extensive in v6. I don't know the extent of your customisation but if you want help using the component creator and using properties to customise your component, let us know and we will do what we can to help. Remember all the components and demos in FCv6 are written in Flowcode as flowcharts, so anything you can see and use there is possible.

Jonny
So if you could post any info Jonny as a starting point, that would be great..


cheers
Acestu

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 12:08 am
by Afsal
My doubt is simple below mentioned the message what I got it from 4d forum

""
Unfortunately, projects with the PIC mcu are written in MPLABX with an XC8 compiler. But looking at the Flowcode software, it generally uses the uart/serial ports the same way with those written with a code. The code-less manner of using the serial ports does simplify the work. The only thing left that needs to be understood is - "How to communicate with the 4D display using serial ports".
This application note will help you understand how to communicate with the 4D display module over serial connection. This application note is related with Workshop - ViSi Genie environment, which is a code-less environment.


http://www.4dsystems.com.au/downloads/S ... REV1.3.pdf



there is a dedicated serial protocol for each object such as winbutton, dip switches, gauges etc...
unfortunately flowcode only supports char and string, so how can I send and read the commands what we getting from the GTX (these commands getting only hex code only)

for the read from 4d display there is a possibility but how to send the HEX code to the display



Tank you very much your valuable time


Afsal

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 8:56 am
by acestu
Hi Afsal,

I have just sent a PM to Jonny to see if he thinks this task would be possible now that Flowcode 6 is here..


cheers
Acestu

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 9:55 am
by JonnyW
Hi. I cant help you much with the specifics of the 4D protocol, but if the comms are done using serial interface all you can communicate using is a byte stream. Hexadecimal is just a representation of numbers - there is no difference between the numbers 65, 0x41 or 'A' internally, its just how you choose to represent them.

I cant imagine that it will be too hard, and will certainly be possible. There are already 4D displays in the components list or you could piggy back on the LCD base - I expect Ben can help you with the details of a specific implementation like that.

If you wanted to start from scratch in this, to create this component you would need to:
  • Create a graphic - maybe just a 2D rectangle
    1_draw.png
    (59.92 KiB) Downloaded 12934 times
  • Add any pins or other properties you may want (this is optional, and I haven't covered it here)
  • Create a macro such as DrawLine that sends the commands required to the display
  • Create a simulation version of the macro, DrawLine_Sim, that will draw a line on the graphic - this must have the same parameters and return type as the download macro
    2_code.png
    (107.65 KiB) Downloaded 12934 times
  • Add a macro to initialise your LCD when simulation starts (you could just have an 'Initialise()' macro, of course)
    3_initialise_event.png
    (54.83 KiB) Downloaded 12934 times
  • Declare your public interface (the macros you can call in Settings Manager): DrawLine is downloadable and DrawLine_Sim is the simulation alternative
    4_declare_api.png
    (67.29 KiB) Downloaded 12934 times
  • Export the component, remembering to make the settings into meaningful values. Flowcode will put the FCPX file in an appropriate location.
    5_export.png
    (32.23 KiB) Downloaded 12934 times
  • Test the component in a new flowchart - the component will be found in 'Outputs'
    6_test_program.png
    (77.09 KiB) Downloaded 12934 times
I have attached demo files for this here.
simple_glcd_example.fcfx
Source of the component
(9.05 KiB) Downloaded 361 times
simple_glcd.fcpx
Compiled component
(1.64 KiB) Downloaded 347 times
simple_glcd_example_t.fcfx
Test program for the component
(4.34 KiB) Downloaded 328 times
I hope this is what you are after and gives you a good starting point.

Jonny

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 12:39 pm
by Benj
Hello,

Does the 4D environment give you a layout file or anything like that. If so then we could potentially parse this file using Flowcode and get the code down into the chip this way.

Sure we can do something to allow this to work.

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 1:27 pm
by Afsal
the workshop only for the display screen layout designing. its not giving any other files, How ever we can monitor the serial communication with the simulator called GTX, this simulator only gives Hex code similar below, how to read and send this type of hex code in FCV 6

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 3:54 pm
by Benj
Hello,

You should be able to use the RS232 component or the COM port component to collect the data.

RS232 component basically has the simulation only COM port component built into it to allow you to talk to real world hardware.

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 4:10 pm
by acestu
Hi Fellas,

Thanks for taking the time to reply Jonny and Benj, I for one will be looking into this, this weekend so I will let you know how I go on.....

cheers
Acestu :D

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 7:58 pm
by acestu
Hi,

I think the easiest way to do this is to start with something simple like a rocker switch, below is a pic of the information that the display sends for switch off & switch on, this switch in 4D's language is only "On Change" event, which means that it only sends info when it is changed from on to off or off to on, a slider is more complicated because it also has the "On Changing" event, so we will have to find a way of sending this info to the pic and getting it recognized.

EDIT I am presuming that the info is just what is inside the green square brackets, the info before is the time
rocker-test.png
(19.28 KiB) Downloaded 12883 times
Also this is how to Query the rocker from pic
rocker-query.png
(19.33 KiB) Downloaded 12882 times
Thanks
Acestu

Re: 4d Display Visi serial commands interface

Posted: Fri Aug 16, 2013 10:06 pm
by Afsal
hi,

Thanks for the valuable time to reply Jonny, Benj and acestu,







thanks and regards

Afsal

Re: 4d Display Visi serial commands interface

Posted: Sun Aug 18, 2013 3:46 pm
by acestu
Hi Afsal,

I have been looking at this problem this weekend, however I think it is a job for someone with coding experience, I believe that it could be done with the information that is available such as the libraries that have been written, simple Arduino examples etc, unfortunately my coding experience is nil which is why I use Flowcode, but I am sure that somebody will pick this problem up and save the day.... :mrgreen:


cheers
Acestu

Re: 4d Display Visi serial commands interface

Posted: Sun Aug 18, 2013 4:03 pm
by Afsal
yes its possible, but should need some coding experience, or else the MM guys should make some macro or serial Hex code read and send function.






regards

Afsal

Re: 4d Display Visi serial commands interface

Posted: Tue Aug 20, 2013 4:59 pm
by Afsal
any update?

Re: 4d Display Visi serial commands interface

Posted: Tue Aug 20, 2013 10:46 pm
by Benj
Hello,

Yes certainly looks possible to do. I will see what I can do and hopefully have something for you to play with later this week.

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 21, 2013 10:53 am
by Benj
Hello,

Here is an updated v6 component which includes macros to support the Visi interface. Simply drop the file into your "Flowcode v6 Beta/Components" directory and restart Flowcode.

Attachment removed as the updated file is now part of update set 2.

If you need any help getting it running then please let me know.

Some good docs on the Visi interface are available from here.
http://www.4dsystems.com.au/product/10/ ... hop_4_IDE/

Note that the Visi components will not currently simulate on the display in Flowcode as the Visi interface is loaded onto the SD card in the 4D display and it would be a huge undertaking to try and replicate all of this functionality.

Another feature that is currently not supported is for Flowcode itself to talk directly to the display i.e. to control it or to pass around Visi messages. Do you think this would be a feature worth including?

Edit: Just spotted a bug, when loading a value from the premade constants for the Visi ReadObject and WriteObject macros they load in as this "gLCD_EB076_4D::VISI_ID_Gauge" but should be edited so they look like this "gLCD_EB076_4D1::VISI_ID_Gauge" e.g. add the 1 after 4D. We are looking into this bug now.

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 21, 2013 3:49 pm
by Benj
Here is a brief example file that interacts with two Visi RockerSwitches with index values 0 and 1.

Switch index 0 will be toggled on and off by the microcontroller.

Switch index 1 will be sampled by the microcontroller and used to control the state of an LED connected to pin RB0.

Again if you would like Flowcode to be able to talk directly to the hardware using the 4D USB cable then let me know, not a big job to add this functionality.

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 21, 2013 6:49 pm
by Benj
Thinking about this.
Visi interface is loaded onto the SD card in the 4D display and it would be a huge undertaking to try and replicate all of this functionality.
If I could figure out how to parse the .dat file and generate the correct visuals for the visi front end then it may not be too bad to add simulation too. Is what we have already enough to make it useable?

Re: 4d Display Visi serial commands interface

Posted: Wed Aug 21, 2013 8:29 pm
by Afsal
Hi benj,


Thanks for your valuable hardwork. (what I am waiting from march onwards)I did not recieve my 4d display my hands, once I recieve I will check this. :D