4d Display Visi serial commands interface

Forum for Flowcode v6 beta users

Moderator: Benj

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

4d Display Visi serial commands interface

Postby Afsal » Wed Aug 14, 2013 7:18 pm

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

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: 4d Display Visi serial commands interface

Postby dazz » Wed Aug 14, 2013 7:21 pm

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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Wed Aug 14, 2013 10:14 pm

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: 4d Display Visi serial commands interface

Postby JonnyW » Wed Aug 14, 2013 10:27 pm

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
These users thanked the author JonnyW for the post:
acestu (Wed Aug 14, 2013 10:32 pm)
Rating: 5.26%
 

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Wed Aug 14, 2013 10:32 pm

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Wed Aug 14, 2013 11:43 pm

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Thu Aug 15, 2013 10:58 pm

hello,

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











thanks

Afsal

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Thu Aug 15, 2013 11:11 pm

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Fri Aug 16, 2013 12:08 am

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

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Fri Aug 16, 2013 8:56 am

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: 4d Display Visi serial commands interface

Postby JonnyW » Fri Aug 16, 2013 9:55 am

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
    1_draw.png (59.92 KiB) Viewed 11549 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
    2_code.png (107.65 KiB) Viewed 11549 times

  • Add a macro to initialise your LCD when simulation starts (you could just have an 'Initialise()' macro, of course)
    3_initialise_event.png
    3_initialise_event.png (54.83 KiB) Viewed 11549 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
    4_declare_api.png (67.29 KiB) Viewed 11549 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
    5_export.png (32.24 KiB) Viewed 11549 times

  • Test the component in a new flowchart - the component will be found in 'Outputs'
    6_test_program.png
    6_test_program.png (77.09 KiB) Viewed 11549 times

I have attached demo files for this here.
simple_glcd_example.fcfx
Source of the component
(9.05 KiB) Downloaded 146 times

simple_glcd.fcpx
Compiled component
(1.64 KiB) Downloaded 138 times

simple_glcd_example_t.fcfx
Test program for the component
(4.34 KiB) Downloaded 141 times


I hope this is what you are after and gives you a good starting point.

Jonny
These users thanked the author JonnyW for the post:
acestu (Fri Aug 16, 2013 4:10 pm)
Rating: 5.26%
 

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Benj » Fri Aug 16, 2013 12:39 pm

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.

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Fri Aug 16, 2013 1:27 pm

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
Attachments
temp.png
temp.png (8.23 KiB) Viewed 11531 times

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Benj » Fri Aug 16, 2013 3:54 pm

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.
These users thanked the author Benj for the post:
acestu (Fri Aug 16, 2013 4:11 pm)
Rating: 5.26%
 

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Fri Aug 16, 2013 4:10 pm

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Fri Aug 16, 2013 7:58 pm

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
rocker-test.png (19.28 KiB) Viewed 11498 times

Also this is how to Query the rocker from pic

rocker-query.png
rocker-query.png (19.33 KiB) Viewed 11497 times

Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Fri Aug 16, 2013 10:06 pm

hi,

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







thanks and regards

Afsal

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: 4d Display Visi serial commands interface

Postby acestu » Sun Aug 18, 2013 3:46 pm

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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Sun Aug 18, 2013 4:03 pm

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

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Tue Aug 20, 2013 4:59 pm

any update?

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Benj » Tue Aug 20, 2013 10:46 pm

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.

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Benj » Wed Aug 21, 2013 10:53 am

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.

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Benj » Wed Aug 21, 2013 3:49 pm

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.
Attachments
Visi Demo.fcfx
(7.95 KiB) Downloaded 133 times
These users thanked the author Benj for the post (total 2):
dazz (Wed Aug 21, 2013 5:24 pm) • acestu (Wed Aug 21, 2013 6:03 pm)
Rating: 10.53%
 

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Benj » Wed Aug 21, 2013 6:49 pm

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?
These users thanked the author Benj for the post:
acestu (Wed Aug 21, 2013 11:13 pm)
Rating: 5.26%
 

Afsal
Posts: 19
Joined: Sun Jun 19, 2011 8:01 pm
Been thanked: 5 times
Contact:

Re: 4d Display Visi serial commands interface

Postby Afsal » Wed Aug 21, 2013 8:29 pm

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
These users thanked the author Afsal for the post:
Benj (Wed Aug 21, 2013 8:32 pm)
Rating: 5.26%